When you use a number such as 45 in a c# program, the number is a

On this page:

What is type 2 diabetes?

Type 2 diabetes, the most common type of diabetes, is a disease that occurs when your blood glucose, also called blood sugar, is too high. Blood glucose is your main source of energy and comes mainly from the food you eat. Insulin, a hormone made by the pancreas, helps glucose get into your cells to be used for energy. In type 2 diabetes, your body doesn’t make enough insulin or doesn’t use insulin well. Too much glucose then stays in your blood, and not enough reaches your cells.

The good news is that you can take steps to prevent or delay the development of type 2 diabetes.

Who is more likely to develop type 2 diabetes?

You can develop type 2 diabetes at any age, even during childhood. However, type 2 diabetes occurs most often in middle-aged and older people. You are more likely to develop type 2 diabetes if you are age 45 or older, have a family history of diabetes, or are overweight or have obesity. Diabetes is more common in people who are African American, Hispanic/Latino, American Indian, Asian American, or Pacific Islander.

Physical inactivity and certain health problems such as high blood pressure affect your chances of developing type 2 diabetes. You are also more likely to develop type 2 diabetes if you have prediabetes or had gestational diabetes when you were pregnant. Learn more about risk factors for type 2 diabetes.

When you use a number such as 45 in a c# program, the number is a
Type 2 diabetes occurs most often in middle-aged and older people.

What are the symptoms of diabetes?

Symptoms of diabetes include

  • increased thirst and urination
  • increased hunger
  • feeling tired
  • blurred vision
  • numbness or tingling in the feet or hands
  • sores that do not heal
  • unexplained weight loss

Symptoms of type 2 diabetes often develop slowly—over the course of several years—and can be so mild that you might not even notice them. Many people have no symptoms. Some people do not find out they have the disease until they have diabetes-related health problems, such as blurred vision or heart disease.

What causes type 2 diabetes?

Type 2 diabetes is caused by several factors, including

  • overweight and obesity
  • not being physically active
  • insulin resistance
  • genes

Learn more about the causes of type 2 diabetes.

How do health care professionals diagnose type 2 diabetes?

Your health care professional can diagnose type 2 diabetes based on blood tests. Learn more about blood tests for diabetes and what the results mean.

How can I manage my type 2 diabetes?

Managing your blood glucose, blood pressure, and cholesterol, and quitting smoking if you smoke, are important ways to manage your type 2 diabetes. Lifestyle changes that include planning healthy meals, limiting calories if you are overweight, and being physically active are also part of managing your diabetes. So is taking any prescribed medicines. Work with your health care team to create a diabetes care plan that works for you.

When you use a number such as 45 in a c# program, the number is a
Following your meal plan helps you manage your diabetes.

What medicines do I need to treat my type 2 diabetes?

Along with following your diabetes care plan, you may need diabetes medicines, which may include pills or medicines you inject under your skin, such as insulin. Over time, you may need more than one diabetes medicine to manage your blood glucose. Even if you don’t take insulin, you may need it at special times, such as during pregnancy or if you are in the hospital. You also may need medicines for high blood pressure, high cholesterol, or other conditions.

Learn more about medicines, insulin, and other diabetes treatments.

What health problems can people with diabetes develop?

Following a good diabetes care plan can help protect against many diabetes-related health problems. However, if not managed, diabetes can lead to problems such as

  • heart disease and stroke
  • nerve damage
  • kidney disease
  • foot problems
  • eye disease
  • gum disease and other dental problems
  • sexual and bladder problems

Many people with type 2 diabetes also have nonalcoholic fatty liver disease (NAFLD). Losing weight if you are overweight or have obesity can improve NAFLD. Diabetes is also linked to other health problems such as sleep apnea, depression, some types of cancer, and dementia.

You can take steps to lower your chances of developing these diabetes-related health problems.

How can I lower my chances of developing type 2 diabetes?

Research such as the Diabetes Prevention Program, sponsored by the National Institutes of Health, has shown that you can take steps to reduce your chances of developing type 2 diabetes if you have risk factors for the disease. Here are some things you can do to lower your risk:

  • Lose weight if you are overweight, and keep it off. You may be able to prevent or delay diabetes by losing 5 to 7 percent of your current weight.1 For instance, if you weigh 200 pounds, your goal would be to lose about 10 to 14 pounds.
  • Move more. Get at least 30 minutes of physical activity, such as walking, at least 5 days a week. If you have not been active, talk with your health care professional about which activities are best. Start slowly and build up to your goal.
  • Eat healthy foods. Eat smaller portions to reduce the amount of calories you eat each day and help you lose weight. Choosing foods with less fat is another way to reduce calories. Drink water instead of sweetened beverages.

Ask your health care team what other changes you can make to prevent or delay type 2 diabetes.

Most often, your best chance for preventing type 2 diabetes is to make lifestyle changes that work for you long term. Get started with Your Game Plan to Prevent Type 2 Diabetes.

References

[1] Diabetes Prevention Program Research Group. Long-term effects of lifestyle intervention or metformin on diabetes development and microvascular complications over 15-year follow-up: the Diabetes Prevention Program Outcomes Study. The Lancet Diabetes & Endocrinology. 2015;3(11):866‒875. You can find more information about this study on the Diabetes Prevention Program Outcomes Study website.

If you're new to Excel for the web, you'll soon find that it's more than just a grid in which you enter numbers in columns or rows. Yes, you can use Excel for the web to find totals for a column or row of numbers, but you can also calculate a mortgage payment, solve math or engineering problems, or find a best case scenario based on variable numbers that you plug in.

Excel for the web does this by using formulas in cells. A formula performs calculations or other actions on the data in your worksheet. A formula always starts with an equal sign (=), which can be followed by numbers, math operators (such as a plus or minus sign), and functions, which can really expand the power of a formula.

For example, the following formula multiplies 2 by 3 and then adds 5 to that result to come up with the answer, 11.

=2*3+5

This next formula uses the PMT function to calculate a mortgage payment ($1,073.64), which is based on a 5 percent interest rate (5% divided by 12 months equals the monthly interest rate) over a 30-year period (360 months) for a $200,000 loan:

=PMT(0.05/12,360,200000)

Here are some additional examples of formulas that you can enter in a worksheet.

  • =A1+A2+A3Adds the values in cells A1, A2, and A3.

  • =SQRT(A1)Uses the SQRT function to return the square root of the value in A1.

  • =TODAY()Returns the current date.

  • =UPPER("hello") Converts the text "hello" to "HELLO" by using the UPPER worksheet function.

  • =IF(A1>0)Tests the cell A1 to determine if it contains a value greater than 0.

The parts of a formula

A formula can also contain any or all of the following: functions, references, operators, and constants.

When you use a number such as 45 in a c# program, the number is a

1. Functions: The PI() function returns the value of pi: 3.142...

2. References: A2 returns the value in cell A2.

3. Constants: Numbers or text values entered directly into a formula, such as 2.

4. Operators: The ^ (caret) operator raises a number to a power, and the * (asterisk) operator multiplies numbers.

Using constants in formulas

A constant is a value that is not calculated; it always stays the same. For example, the date 10/9/2008, the number 210, and the text "Quarterly Earnings" are all constants. An expression or a value resulting from an expression is not a constant. If you use constants in a formula instead of references to cells (for example, =30+70+110), the result changes only if you modify the formula.

Using calculation operators in formulas

Operators specify the type of calculation that you want to perform on the elements of a formula. There is a default order in which calculations occur (this follows general mathematical rules), but you can change this order by using parentheses.

Types of operators

There are four different types of calculation operators: arithmetic, comparison, text concatenation, and reference.

Arithmetic operators

To perform basic mathematical operations, such as addition, subtraction, multiplication, or division; combine numbers; and produce numeric results, use the following arithmetic operators.

Arithmetic operator

Meaning

Example

+ (plus sign)

Addition

3+3

– (minus sign)

Subtraction
Negation

3–1
–1

* (asterisk)

Multiplication

3*3

/ (forward slash)

Division

3/3

% (percent sign)

Percent

20%

^ (caret)

Exponentiation

3^2

Comparison operators

You can compare two values with the following operators. When two values are compared by using these operators, the result is a logical value— either TRUE or FALSE.

Comparison operator

Meaning

Example

= (equal sign)

Equal to

A1=B1

> (greater than sign)

Greater than

A1>B1

< (less than sign)

Less than

A1<B1

>= (greater than or equal to sign)

Greater than or equal to

A1>=B1

<= (less than or equal to sign)

Less than or equal to

A1<=B1

<> (not equal to sign)

Not equal to

A1<>B1

Text concatenation operator

Use the ampersand (&) to concatenate (join) one or more text strings to produce a single piece of text.

Text operator

Meaning

Example

& (ampersand)

Connects, or concatenates, two values to produce one continuous text value

"North"&"wind" results in "Northwind"

Reference operators

Combine ranges of cells for calculations with the following operators.

Reference operator

Meaning

Example

: (colon)

Range operator, which produces one reference to all the cells between two references, including the two references.

B5:B15

, (comma)

Union operator, which combines multiple references into one reference

SUM(B5:B15,D5:D15)

(space)

Intersection operator, which produces one reference to cells common to the two references

B7:D7 C6:C8

The order in which Excel for the web performs operations in formulas

In some cases, the order in which a calculation is performed can affect the return value of the formula, so it's important to understand how the order is determined and how you can change the order to obtain the results you want.

Calculation order

Formulas calculate values in a specific order. A formula always begins with an equal sign (=). Excel for the web interprets the characters that follow the equal sign as a formula. Following the equal sign are the elements to be calculated (the operands), such as constants or cell references. These are separated by calculation operators. Excel for the web calculates the formula from left to right, according to a specific order for each operator in the formula.

Operator precedence

If you combine several operators in a single formula, Excel for the web performs the operations in the order shown in the following table. If a formula contains operators with the same precedence—for example, if a formula contains both a multiplication and division operator— Excel for the web evaluates the operators from left to right.

Operator

Description

: (colon)

(single space)

, (comma)

Reference operators

Negation (as in –1)

%

Percent

^

Exponentiation

* and /

Multiplication and division

+ and –

Addition and subtraction

&

Connects two strings of text (concatenation)

=
< >
<=
>=
<>

Comparison

Use of parentheses

To change the order of evaluation, enclose in parentheses the part of the formula to be calculated first. For example, the following formula produces 11 because Excel for the web performs multiplication before addition. The formula multiplies 2 by 3 and then adds 5 to the result.

=5+2*3

In contrast, if you use parentheses to change the syntax, Excel for the web adds 5 and 2 together and then multiplies the result by 3 to produce 21.

=(5+2)*3

In the following example, the parentheses that enclose the first part of the formula force Excel for the web to calculate B4+25 first and then divide the result by the sum of the values in cells D5, E5, and F5.

=(B4+25)/SUM(D5:F5)

Using functions and nested functions in formulas

Functions are predefined formulas that perform calculations by using specific values, called arguments, in a particular order, or structure. Functions can be used to perform simple or complex calculations.

The syntax of functions

The following example of the ROUND function rounding off a number in cell A10 illustrates the syntax of a function.

When you use a number such as 45 in a c# program, the number is a

1. Structure. The structure of a function begins with an equal sign (=), followed by the function name, an opening parenthesis, the arguments for the function separated by commas, and a closing parenthesis.

2. Function name. For a list of available functions, click a cell and press SHIFT+F3.

3. Arguments. Arguments can be numbers, text, logical values such as TRUE or FALSE, arrays, error values such as #N/A, or cell references. The argument you designate must produce a valid value for that argument. Arguments can also be constants, formulas, or other functions.

4. Argument tooltip. A tooltip with the syntax and arguments appears as you type the function. For example, type =ROUND( and the tooltip appears. Tooltips appear only for built-in functions.

Entering functions

When you create a formula that contains a function, you can use the Insert Function dialog box to help you enter worksheet functions. As you enter a function into the formula, the Insert Function dialog box displays the name of the function, each of its arguments, a description of the function and each argument, the current result of the function, and the current result of the entire formula.

To make it easier to create and edit formulas and minimize typing and syntax errors, use Formula AutoComplete. After you type an = (equal sign) and beginning letters or a display trigger, Excel for the web displays, below the cell, a dynamic drop-down list of valid functions, arguments, and names that match the letters or trigger. You can then insert an item from the drop-down list into the formula.

Nesting functions

In certain cases, you may need to use a function as one of the arguments of another function. For example, the following formula uses a nested AVERAGE function and compares the result with the value 50.

When you use a number such as 45 in a c# program, the number is a

1. The AVERAGE and SUM functions are nested within the IF function.

Valid returnsWhen a nested function is used as an argument, the nested function must return the same type of value that the argument uses. For example, if the argument returns a TRUE or FALSE value, the nested function must return a TRUE or FALSE value. If the function doesn't, Excel for the web displays a #VALUE! error value.

Nesting level limitsA formula can contain up to seven levels of nested functions. When one function (we'll call this Function B) is used as an argument in another function (we'll call this Function A), Function B acts as a second-level function. For example, the AVERAGE function and the SUM function are both second-level functions if they are used as arguments of the IF function. A function nested within the nested AVERAGE function is then a third-level function, and so on.

Using references in formulas

A reference identifies a cell or a range of cells on a worksheet, and tells Excel for the web where to look for the values or data you want to use in a formula. You can use references to use data contained in different parts of a worksheet in one formula or use the value from one cell in several formulas. You can also refer to cells on other sheets in the same workbook, and to other workbooks. References to cells in other workbooks are called links or external references.

The A1 reference style

The default reference styleBy default, Excel for the web uses the A1 reference style, which refers to columns with letters (A through XFD, for a total of 16,384 columns) and refers to rows with numbers (1 through 1,048,576). These letters and numbers are called row and column headings. To refer to a cell, enter the column letter followed by the row number. For example, B2 refers to the cell at the intersection of column B and row 2.

To refer to

Use

The cell in column A and row 10

A10

The range of cells in column A and rows 10 through 20

A10:A20

The range of cells in row 15 and columns B through E

B15:E15

All cells in row 5

5:5

All cells in rows 5 through 10

5:10

All cells in column H

H:H

All cells in columns H through J

H:J

The range of cells in columns A through E and rows 10 through 20

A10:E20

Making a reference to another worksheetIn the following example, the AVERAGE worksheet function calculates the average value for the range B1:B10 on the worksheet named Marketing in the same workbook.

When you use a number such as 45 in a c# program, the number is a

1. Refers to the worksheet named Marketing

2. Refers to the range of cells between B1 and B10, inclusively

3. Separates the worksheet reference from the cell range reference

The difference between absolute, relative and mixed references

Relative referencesA relative cell reference in a formula, such as A1, is based on the relative position of the cell that contains the formula and the cell the reference refers to. If the position of the cell that contains the formula changes, the reference is changed. If you copy or fill the formula across rows or down columns, the reference automatically adjusts. By default, new formulas use relative references. For example, if you copy or fill a relative reference in cell B2 to cell B3, it automatically adjusts from =A1 to =A2.

When you use a number such as 45 in a c# program, the number is a

Absolute referencesAn absolute cell reference in a formula, such as $A$1, always refer to a cell in a specific location. If the position of the cell that contains the formula changes, the absolute reference remains the same. If you copy or fill the formula across rows or down columns, the absolute reference does not adjust. By default, new formulas use relative references, so you may need to switch them to absolute references. For example, if you copy or fill an absolute reference in cell B2 to cell B3, it stays the same in both cells: =$A$1.

When you use a number such as 45 in a c# program, the number is a

Mixed referencesA mixed reference has either an absolute column and relative row, or absolute row and relative column. An absolute column reference takes the form $A1, $B1, and so on. An absolute row reference takes the form A$1, B$1, and so on. If the position of the cell that contains the formula changes, the relative reference is changed, and the absolute reference does not change. If you copy or fill the formula across rows or down columns, the relative reference automatically adjusts, and the absolute reference does not adjust. For example, if you copy or fill a mixed reference from cell A2 to B3, it adjusts from =A$1 to =B$1.

When you use a number such as 45 in a c# program, the number is a

The 3-D reference style

Conveniently referencing multiple worksheetsIf you want to analyze data in the same cell or range of cells on multiple worksheets within a workbook, use a 3-D reference. A 3-D reference includes the cell or range reference, preceded by a range of worksheet names. Excel for the web uses any worksheets stored between the starting and ending names of the reference. For example, =SUM(Sheet2:Sheet13!B5) adds all the values contained in cell B5 on all the worksheets between and including Sheet 2 and Sheet 13.

  • You can use 3-D references to refer to cells on other sheets, to define names, and to create formulas by using the following functions: SUM, AVERAGE, AVERAGEA, COUNT, COUNTA, MAX, MAXA, MIN, MINA, PRODUCT, STDEV.P, STDEV.S, STDEVA, STDEVPA, VAR.P, VAR.S, VARA, and VARPA.

  • 3-D references cannot be used in array formulas.

  • 3-D references cannot be used with the intersection operator (a single space) or in formulas that use implicit intersection.

What occurs when you move, copy, insert, or delete worksheetsThe following examples explain what happens when you move, copy, insert, or delete worksheets that are included in a 3-D reference. The examples use the formula =SUM(Sheet2:Sheet6!A2:A5) to add cells A2 through A5 on worksheets 2 through 6.

  • Insert or copyIf you insert or copy sheets between Sheet2 and Sheet6 (the endpoints in this example), Excel for the web includes all values in cells A2 through A5 from the added sheets in the calculations.

  • Delete If you delete sheets between Sheet2 and Sheet6, Excel for the web removes their values from the calculation.

  • MoveIf you move sheets from between Sheet2 and Sheet6 to a location outside the referenced sheet range, Excel for the web removes their values from the calculation.

  • Move an endpointIf you move Sheet2 or Sheet6 to another location in the same workbook, Excel for the web adjusts the calculation to accommodate the new range of sheets between them.

  • Delete an endpointIf you delete Sheet2 or Sheet6, Excel for the web adjusts the calculation to accommodate the range of sheets between them.

The R1C1 reference style

You can also use a reference style where both the rows and the columns on the worksheet are numbered. The R1C1 reference style is useful for computing row and column positions in macros. In the R1C1 style, Excel for the web indicates the location of a cell with an "R" followed by a row number and a "C" followed by a column number.

Reference

Meaning

R[-2]C

A relative reference to the cell two rows up and in the same column

R[2]C[2]

A relative reference to the cell two rows down and two columns to the right

R2C2

An absolute reference to the cell in the second row and in the second column

R[-1]

A relative reference to the entire row above the active cell

R

An absolute reference to the current row

When you record a macro, Excel for the web records some commands by using the R1C1 reference style. For example, if you record a command, such as clicking the AutoSum button to insert a formula that adds a range of cells, Excel for the web records the formula by using R1C1 style, not A1 style, references.

Using names in formulas

You can create defined names to represent cells, ranges of cells, formulas, constants, or Excel for the web tables. A name is a meaningful shorthand that makes it easier to understand the purpose of a cell reference, constant, formula, or table, each of which may be difficult to comprehend at first glance. The following information shows common examples of names and how using them in formulas can improve clarity and make formulas easier to understand.

Example Type

Example, using ranges instead of names

Example, using names

Reference

=SUM(A16:A20)

=SUM(Sales)

Constant

=PRODUCT(A12,9.5%)

=PRODUCT(Price,KCTaxRate)

Formula

=TEXT(VLOOKUP(MAX(A16,A20),A16:B20,2,FALSE),"m/dd/yyyy")

=TEXT(VLOOKUP(MAX(Sales),SalesInfo,2,FALSE),"m/dd/yyyy")

Table

A22:B25

=PRODUCT(Price,Table1[@Tax Rate])

Types of names

There are several types of names that you can create and use.

Defined nameA name that represents a cell, range of cells, formula, or constant value. You can create your own defined name. Also, Excel for the web sometimes creates a defined name for you, such as when you set a print area.

Table nameA name for an Excel for the web table, which is a collection of data about a particular subject that is stored in records (rows) and fields (columns). Excel for the web creates a default Excel for the web table name of "Table1", "Table2", and so on, each time you insert an Excel for the web table, but you can change these names to make them more meaningful.

Creating and entering names

You create a name by using Create a name from selection. You can conveniently create names from existing row and column labels by using a selection of cells in the worksheet.

Note:By default, names use absolute cell references.

You can enter a name by:

  • Typing Typing the name, for example, as an argument to a formula.

  • Using Formula AutoCompleteUse the Formula AutoComplete drop-down list, where valid names are automatically listed for you.

Using array formulas and array constants

Excel for the web doesn’t support creating array formulas. You can view the results of array formulas created in Excel desktop application, but you can’t edit or recalculate them. If you have the Excel desktop application, click Open in Excel to work with arrays.

The following array example calculates the total value of an array of stock prices and shares, without using a row of cells to calculate and display the individual values for each stock.

When you use a number such as 45 in a c# program, the number is a

When you enter the formula ={SUM(B2:D2*B3:D3)} as an array formula, it multiples the Shares and Price for each stock, and then adds the results of those calculations together.

To calculate multiple resultsSome worksheet functions return arrays of values, or require an array of values as an argument. To calculate multiple results with an array formula, you must enter the array into a range of cells that has the same number of rows and columns as the array arguments.

For example, given a series of three sales figures (in column B) for a series of three months (in column A), the TREND function determines the straight-line values for the sales figures. To display all the results of the formula, it is entered into three cells in column C (C1:C3).

When you use a number such as 45 in a c# program, the number is a

When you enter the formula =TREND(B1:B3,A1:A3) as an array formula, it produces three separate results (22196, 17079, and 11962), based on the three sales figures and the three months.

Using array constants

In an ordinary formula, you can enter a reference to a cell containing a value, or the value itself, also called a constant. Similarly, in an array formula you can enter a reference to an array, or enter the array of values contained within the cells, also called an array constant. Array formulas accept constants in the same way that non-array formulas do, but you must enter the array constants in a certain format.

Array constants can contain numbers, text, logical values such as TRUE or FALSE, or error values such as #N/A. Different types of values can be in the same array constant— for example, {1,3,4;TRUE,FALSE,TRUE}. Numbers in array constants can be in integer, decimal, or scientific format. Text must be enclosed in double quotation marks — for example, "Tuesday".

Array constants cannot contain cell references, columns or rows of unequal length, formulas, or the special characters $ (dollar sign), parentheses, or % (percent sign).

When you format array constants, make sure you:

  • Enclose them in braces ( { } ).

  • Separate values in different columns by using commas (,). For example, to represent the values 10, 20, 30, and 40, you enter {10,20,30,40}. This array constant is known as a 1-by-4 array and is equivalent to a 1-row-by-4-column reference.

  • Separate values in different rows by using semicolons (;). For example, to represent the values 10, 20, 30, and 40 in one row and 50, 60, 70, and 80 in the row immediately below, you enter a 2-by-4 array constant: {10,20,30,40;50,60,70,80}.