Anda di halaman 1dari 37

IF function Show All This article describes the formula syntax and usage of the IF function in Microsoft Excel.

Work with our examples of the IF function in an embedded workbook, in which you can watch the answers appear in real time!

Description The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE. For example, the formula =IF(A1>10,"Over 10","10 or less") returns "Over 10" if A1 is greater than 10, and "10 or less" if A1 is less than or equal to 10. Syntax IF(logical_test, [value_if_true], [value_if_false]) The IF function syntax has the following arguments:

logical_test Required. Any value or expression that can be evaluated to TRUE or FALSE. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE. This argument can use any comparison calculation operator.

value_if_true Optional. The value that you want to be returned if the logical_test argument evaluates to TRUE. For example, if the value of this argument is the text string "Within budget" and the logical_test argument evaluates to TRUE, the IF function returns the text "Within budget." If logical_test evaluates to TRUE and the value_if_true argument is omitted (that is, there is only a comma following the logical_test argument), the IF function returns 0 (zero). To display the word TRUE, use the logical value TRUE for the value_if_true argument.

value_if_false Optional. The value that you want to be returned if the logical_test argument evaluates to FALSE. For example, if the value of this argument is the text string

"Over budget" and the logical_test argument evaluates to FALSE, the IF function returns the text "Over budget." If logical_test evaluates to FALSE and the value_if_false argument is omitted, (that is, there is no comma following the value_if_true argument), the IF function returns the logical value FALSE. If logical_test evaluates to FALSE and the value of the value_if_false argument is omitted (that is, in the IF function, there is no comma following the value_if_true argument), the IF function returns the value 0 (zero). Remarks

Up to 64 IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. (See Example 3 for a sample of nested IF functions.) Alternatively, to test many conditions, consider using the LOOKUP, VLOOKUP, HLOOKUP, or CHOOSE functions. (See Example 4 for a sample of the LOOKUP function.)

If any of the arguments to IF are arrays, every element of the array is evaluated when the IF statement is carried out.

Excel provides additional functions that can be used to analyse your data based on a condition. For example, to count the number of occurrences of a string of text or a number within a range of cells, use the COUNTIF or the COUNTIFS worksheet functions. To calculate a sum based on a string of text or a number within a range, use the SUMIF or the SUMIFS worksheet functions. Examples

EXAMPLE 1 This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. The formulas in these examples use the IF function to test the contents of a cell against values to determine a value to return in another cell. Work with this example of the IF function in an embedded workbook

With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view. In full-size browser view, you can then click the Download button , which enables you to open the entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser). EXAMPLE 2 The formulas in these examples use the IF function to test the contents of a cell to determine if an expense is over budget. Work with this example of the IF function in an embedded workbook EXAMPLE 3 The formulas in these examples demonstrate how you can nest IF statements. In each formula, the fourth IF statement is also the value_if_false argument to the third IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement, and the second IF statement is the value_if_false argument to the first IF statement. For example, if the first logical_test argument (Average>89) evaluates to TRUE, "A" is returned. If the first logical_test argument evaluates to FALSE, the second IF statement is evaluated, and so on. You can also use other functions as arguments. Work with this example of the IF function in an embedded workbook The letter grades are assigned to numbers, using the following key.

IF SCORE IS From 80 to 89 From 70 to 79 From 60 to 69 Less than 60

THEN RETURN B C D F

Greater than 89 A

EXAMPLE 4 In this example, the LOOKUP function is used instead of the IF function because there are thirteen conditions to test. You may find the LOOKUP function easier to read and maintain than the IF function. Work with this example of the IF function in an embedded workbook

SUMPRODUCT function
Show All This article describes the formula syntax and usage of the SUMPRODUCT function in Microsoft Excel.

Work with our examples of the SUMPRODUCT function in an embedded workbook, in which you can watch the answers appear in real time!

Description
Multiplies corresponding components in the given arrays, and returns the sum of those products.

Syntax
SUMPRODUCT(array1, [array2], [array3], ...)
The SUMPRODUCT function syntax has the following arguments:

Array1 Required. The first array argument whose components you want to multiply and then add. Array2, array3,... Optional. Array arguments 2 to 255 whose components you want to multiply and then add.

Remarks

The array arguments must have the same dimensions. If they do not, SUMPRODUCT returns the #VALUE! error value.

SUMPRODUCT treats array entries that are not numeric as if they were zeros.

Example
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. Work with this example of the SUMPRODUCT function in an embedded workbook

The preceding example returns the same result as the formula SUM(A2:B4*C2:D4) entered as an array in the Excel desktop application. Using arrays provides a more general solution for doing operations similar to

SUMPRODUCT. For example, you can calculate the sum of the squares of the elements in A2:B4 by using the formula =SUM(A2:B4^2) and pressing CTRL+SHIFT+ENTER With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

ROUND function
Show All This article describes the formula syntax and usage of the ROUND function in Microsoft Excel.

Work with our examples of the ROUND function in an embedded workbook, in which you can watch the answers appear in real time!

Description
The ROUND function rounds a number to a specified number of digits. For example, if cell A1 contains 23.7825, and you want to round that value to two decimal places, you can use the following formula:

=ROUND(A1, 2)
The result of this function is 23.78.

Syntax
ROUND(number, num_digits)
The ROUND function syntax has the following arguments:

number Required. The number that you want to round. num_digits Required. The number of digits to which you want to round the number argument.

Remarks

If num_digits is greater than 0 (zero), then number is rounded to the specified number of decimal places. If num_digits is 0, the number is rounded to the nearest integer. If num_digits is less than 0, the number is rounded to the left of the decimal point. To always round up (away from zero), use the ROUNDUP function. To always round down (toward zero), use the ROUNDDOWN function. To round a number to a specific multiple (for example, to round to the nearest 0.5), use the MROUND function.

Example
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. In these examples, the ROUND function is used to round numbers to a specified number of digits.

Work with these examples of the ROUND function in an embedded workbook With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

RANDBETWEEN function
Show All This article describes the formula syntax and usage of the RANDBETWEEN function in Microsoft Excel.

Description
Returns a random integer number between the numbers you specify. A new random integer number is returned every time the worksheet is calculated.

Syntax
RANDBETWEEN(bottom, top)
The RANDBETWEEN function syntax has the following arguments:

Bottom Required. The smallest integer RANDBETWEEN will return. Top Required. The largest integer RANDBETWEEN will return.

Example
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? 1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time. Important: Do not select the row or column headers. 1. 2. 3. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 1. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 =RANDBETWEEN(-1,1) Formula =RANDBETWEEN(1,100)

B Description (Result) Random number between 1 and 100 (varies) Random number between -1 and 1 (varies)

SUM function
Show All This article describes the formula syntax and usage of the SUM function in Microsoft Excel.

Work with our examples of the SUM function in an embedded workbook, in which you can watch the answers appear in real time!

Description
The SUM function adds all the numbers that you specify as arguments. Each argument can be a range, a cell reference, an array, a constant, a formula, or the result from another function. For example, SUM(A1:A5) adds all the numbers that are contained in cells A1 through A5. For another example, SUM(A1, A3, A5) adds the numbers that are contained in cells A1, A3, and A5.

Syntax
SUM(number1,[number2],...])
The SUM function syntax has the following arguments:

number1 Required. The first number argument that you want to add. number2,,... Optional. Number arguments 2 to 255 that you want to add.

Remarks

If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, or text in the array or reference are ignored.

If any arguments are error values, or if any arguments are text that cannot be translated into numbers, Excel displays an error.

Example
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. These examples show common formulas using the SUM function.

Work with these examples of the SUM function in an embedded workbook With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

PMT function
Show All This article describes the formula syntax and usage of the PMT function in Microsoft Excel.

Work with our examples of the PMT function in an embedded workbook, in which you can watch the answers appear in real time!

Description
Calculates the payment for a loan based on constant payments and a constant interest rate.

Syntax
PMT(rate, nper, pv, [fv], [type])
NOTE For a more complete description of the arguments in PMT, see the PV function.

The PMT function syntax has the following arguments:

Rate Required. The interest rate for the loan. Nper Required. The total number of payments for the loan. Pv Required. The present value, or the total amount that a series of future payments is worth now; also known as the principal.

Fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.

Type Optional. The number 0 (zero) or 1 and indicates when payments are due.
SET TYPE EQUAL TO 0 or omitted 1 IF PAYMENTS ARE DUE At the end of the period At the beginning of the period

Remarks

The payment returned by PMT includes principal and interest but no taxes, reserve payments, or fees sometimes associated with loans.

Make sure that you are consistent about the units you use for specifying rate and nper. If you make monthly payments on a four-year loan at an annual interest rate of 12 percent, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12 percent for rate and 4 for nper. Tip To find the total amount paid over the duration of the loan, multiply the returned PMT value by nper.

Examples
EXAMPLE 1
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. This example uses the PMT function to determine the monthly payment for a loan. Work with this example of the PMT function in an embedded workbook With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

EXAMPLE 2
This example uses the PMT function to determine the amount to save each month to have $50,000 at the end of 18 years.

Work with this example of the PMT function in an embedded workbook


NOTE The interest rate is divided by 12 to get a monthly rate. The number of years the money is paid out is

multiplied by 12 to get the number of payments.

MINVERSE function
Show All This article describes the formula syntax and usage of the MINVERSE function in Microsoft Excel.

Description
Returns the inverse matrix for the matrix stored in an array.

Syntax
MINVERSE(array)
The MINVERSE function syntax has the following arguments:

Array Required. A numeric array with an equal number of rows and columns.

Remarks

Array can be given as a cell range, such as A1:C3; as an array constant, such as {1,2,3;4,5,6;7,8,9}; or as a name for either of these.

If any cells in array are empty or contain text, MINVERSE returns the #VALUE! error value. MINVERSE also returns the #VALUE! error value if array does not have an equal number of rows and columns.

Formulas that return arrays must be entered as array formulas. Inverse matrices, like determinants, are generally used for solving systems of mathematical equations involving several variables. The product of a matrix and its inverse is the identity matrix the square array in which the diagonal values equal 1, and all other values equal 0.

As an example of how a two-row, two-column matrix is calculated, suppose that the range A1:B2 contains the letters a, b, c, and d that represent any four numbers. The following table shows the inverse of the matrix A1:B2.
COLUMN A Row 1 Row 2 d/(a*d-b*c) c/(b*c-a*d) COLUMN B b/(b*c-a*d) a/(a*d-b*c)

MINVERSE is calculated with an accuracy of approximately 16 digits, which may lead to a small numeric error when the cancellation is not complete.

Some square matrices cannot be inverted and will return the #NUM! error value with MINVERSE. The determinant for a noninvertable matrix is 0.

Example
EXAMPLE 1
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? 1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers. 2. 3. 4. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 2 Formula =MINVERSE(A2:B3) Data 4

B Data -1 0 Formula

NOTES

The formula in the example must be entered as an array formula in the Excel desktop application. After copying the example to a blank worksheet, select the range A5:B6 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single result is 0.

In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the Number group, click the arrow next to Number Format, and click General.

EXAMPLE 2
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? 6. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers. 7. 8. 9. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 10. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 3 0 Formula =MINVERSE(A2:C4) Data 1

B Data 2 4 2 Formula

C Data 1 -1 0 Formula

NOTES

The formula in the example must be entered as an array formula n the Excel desktop application. After copying the example to a blank worksheet, select the range A6:C8 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single result is 0.25.

In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the Number group, click the arrow next to Number Format, and click General

MMULT function
This article describes the formula syntax and usage of the MMULT function in Microsoft Excel.

Description
Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.

Syntax
MMULT(array1, array2)
The MMULT function syntax has the following arguments:

Array1, array2 Required. The arrays you want to multiply.

Remarks

The number of columns in array1 must be the same as the number of rows in array2, and both arrays must contain only numbers.

Array1 and array2 can be given as cell ranges, array constants, or references. MMULT returns the #VALUE! error when: Any cells are empty or contain text. The number of columns in array1 is different from the number of rows in array2.

Formulas that return arrays must be entered as array formulas.


NOTE In Excel Web App you cannot create array formulas.

Example
EXAMPLE 1
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example?

1.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

2. 3. 4.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 7 8 0 Formula =MMULT(A2:B3,A5:B6) 7 Array 2 2 Array 1 1

B Array 1 3 2 Array 2 0 2 Formula

NOTE The formula in the example must be entered as an array formula. After copying the example to a

blank worksheet, select the range A8:B9 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single result is 2.

EXAMPLE 2
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? 1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers. 2. 3. 4. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 7 8 0 Formula =MMULT(A2:B3,A5:B6) 2 Array 2 2 Array 1 3

B Array 1 0 0 Array 2 0 2 Formula

NOTE The formula in the example must be entered as an array formula in the Excel desktop application. After

copying the example to a blank worksheet, select the range A8:B9 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single result is 6.

WEEKDAY function
Show All This article describes the formula syntax and usage of the WEEKDAY function in Microsoft Excel.

Description
Returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.

Syntax
WEEKDAY(serial_number,[return_type])
The WEEKDAY function syntax has the following arguments:

Serial_number Required. A sequential number that represents the date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.

Return_type Optional. A number that determines the type of return value.


RETURN_TYPE 1 or omitted 2 3 11 12 13 14 15 16 17 NUMBER RETURNED Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel. Numbers 1 (Monday) through 7 (Sunday). Numbers 0 (Monday) through 6 (Sunday). Numbers 1 (Monday) through 7 (Sunday). Numbers 1 (Tuesday) through 7 (Monday). Numbers 1 (Wednesday) through 7 (Tuesday). Numbers 1 (Thursday) through 7 (Wednesday). Numbers 1 (Friday) through 7 (Thursday). Numbers 1 (Saturday) through 7 (Friday). Numbers 1 (Sunday) through 7 (Saturday).

Remark

Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

If serial_number is out of range for the current date base value, a #NUM! error is returned.

If return_type is out of the range specified in the table above, a #NUM! error is returned.

Example
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? 1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers. 1. 2. 3. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 1. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Formula 4 =WEEKDAY(A2) 5 =WEEKDAY(A2, 2) 6 =WEEKDAY(A2, 3) Data 2/14/2008

Description (Result) Day of the week, with numbers 1 (Sunday) through 7 (Saturday) (5) Day of the week, with numbers 1 (Monday) through 7 (Sunday) (4) Day of the week, with numbers 0 (Monday) through 6 (Sunday) (3)

NOTES

2/14/2008 is a Thursday. In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the Number group, click the arrow next to Number Format, and click General.

VLOOKUP function
This article describes the formula syntax and usage of the VLOOKUP function in Microsoft Excel.

Work with our examples of the VLOOKUP function in an embedded workbook, in which you can watch the answers appear in real time!

Description
You can use the VLOOKUP function to search the first column of a range of cells, and then return a value from any cell on the same row of the range. For example, suppose that you have a list of employees contained in the range A2:C10. The employees' ID numbers are stored in the first column of the range, as shown in the following illustration.

If you know the employee's ID number, you can use the VLOOKUP function to return either the department or the name of that employee. To obtain the name of employee number 38, you can use the formula =VLOOKUP(38, A2:C10, 3, FALSE). This formula searches for the value 38 in the first column of the range A2:C10, and then returns the value that is contained in the third column of the range and on the same row as the lookup value ("Axel Delgado"). The V in VLOOKUP stands for vertical. Use VLOOKUP instead of HLOOKUP when your comparison values are located in a column to the left of the data that you want to find.

Syntax
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
The VLOOKUP function syntax has the following arguments:

lookup_value Required. The value to search in the first column of the table or range. The lookup_value argument can be a value or a reference. If the value you supply for the lookup_value argument is smaller than the smallest value in the first column of the table_array argument, VLOOKUP returns the #N/A error value.

table_array Required. The range of cells that contains the data. You can use a reference to a range (for example, A2:D8), or a range name. The values in the first column of table_array are the values searched by lookup_value. These values can be text, numbers, or logical values. Uppercase and lowercase text is equivalent.

col_index_num Required. The column number in the table_array argument from which the matching value must be returned. A col_index_num argument of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. If the col_index_num argument is:

Less than 1, VLOOKUP returns the #VALUE! error value. Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.

range_lookup Optional. A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match: If range_lookup is either TRUE or is omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.
IMPORTANT If range_lookup is either TRUE or is omitted, the values in the first column of

table_array must be placed in ascending sort order; otherwise, VLOOKUP might not return the correct value. For more information, see Sort data in a range or table. If range_lookup is FALSE, the values in the first column of table_array do not need to be sorted.

If the range_lookup argument is FALSE, VLOOKUP will find only an exact match. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.

Remarks

When searching text values in the first column of table_array, ensure that the data in the first column of table_array does not contain leading spaces, trailing spaces, inconsistent use of straight ( ' or " ) and curly ( or ) quotation marks, or nonprinting characters. In these cases, VLOOKUP might return an incorrect or unexpected value. For more information, see CLEAN function and TRIM function.

When searching number or date values, ensure that the data in the first column of table_array is not stored as text values. In this case, VLOOKUP might return an incorrect or unexpected value.

If range_lookup is FALSE and lookup_value is text, you can use the wildcard characters the question mark (?) and asterisk (*) in lookup_value. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.

Example
EXAMPLE 1
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. This example searches the Density column of an atmospheric properties table to find corresponding values in the Viscosity and Temperature columns. (The values are for air at 0 degrees Celsius at sea level, or 1 atmosphere.) Work with this example of the VLOOKUP function in an embedded workbook
NOTE In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the

Number group, click the arrow next to Number Format, and click General. With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

EXAMPLE 2
This example searches the Item-ID column of a baby products table and matches values in the Cost and Markup columns to calculate prices and test conditions. Work with this example of the VLOOKUP function in an embedded workbook
NOTE In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the

Number group, click the arrow next to Number Format, and click General.

EXAMPLE 3
This example searches the ID column of an employee table and matches values in other columns to calculate ages and test for error conditions. Work with this example of the VLOOKUP function in an embedded workbook

CHOOSE function
Show All This article describes the formula syntax and usage of the CHOOSE function in Microsoft Excel.

Work with our examples of the CHOOSE function in an embedded workbook, in which you can watch the answers appear in real time!

Description
Uses index_num to return a value from the list of value arguments. Use CHOOSE to select one of up to 254 values based on the index number. For example, if value1 through value7 are the days of the week, CHOOSE returns one of the days when a number between 1 and 7 is used as index_num.

Syntax
CHOOSE(index_num, value1, [value2], ...)
The CHOOSE function syntax has the following arguments:

Index_num Required. Specifies which value argument is selected. Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number between 1 and 254. If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on. If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value. If index_num is a fraction, it is truncated to the lowest integer before being used.

Value1, value2, ... Value 1 is required, subsequent values are optional. 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or text.

Remarks

If index_num is an array, every value is evaluated when CHOOSE is evaluated. The value arguments to CHOOSE can be range references as well as single values.

For example, the formula:

=SUM(CHOOSE(2,A1:A10,B1:B10,C1:C10))
evaluates to:

=SUM(B1:B10)
which then returns a value based on the values in the range B1:B10. The CHOOSE function is evaluated first, returning the reference B1:B10. The SUM function is then evaluated using B1:B10, the result of the CHOOSE function, as its argument.

Examples
EXAMPLE 1
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. This example uses the CHOOSE function to return the values of specific arguments. Work with this example of the CHOOSE function in an embedded workbook With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the

Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

EXAMPLE 2
This example uses the CHOOSE function to sum a specific range. Work with this example of the CHOOSE function in an embedded workbook

COUNT function
Show All This article describes the formula syntax and usage of the COUNT function in Microsoft Excel.

Work with our examples of the COUNT function in an embedded workbook, in which you can watch the answers appear in real time!

Description
The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers. For example, you can enter the following formula to count the numbers in the range A1:A20:

=COUNT(A1:A20)
In this example, if five of the cells in the range contain numbers, the result is 5.

Syntax
COUNT(value1, [value2], ...)
The COUNT function syntax has the following arguments:

value1 Required. The first item, cell reference, or range within which you want to count numbers. value2, ... Optional. Up to 255 additional items, cell references, or ranges within which you want to count numbers.
NOTE The arguments can contain or refer to a variety of different types of data, but only numbers are counted.

Remarks

Arguments that are numbers, dates, or a text representation of numbers (for example, a number enclosed in quotation marks, such as "1") are counted.

Logical values and text representations of numbers that you type directly into the list of arguments are counted.

Arguments that are error values or text that cannot be translated into numbers are not counted.

If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are not counted.

If you want to count logical values, text, or error values, use the COUNTA function. If you want to count only numbers that meet certain criteria, use the COUNTIF function or the COUNTIFS function.

Example
This help topic links to live data in an embedded workbook. Change data, or modify or create formulas in the worksheet and they will immediately be calculated by Excel Web App a version of Excel that runs on the web. In these examples, the COUNT function counts the number of cells that contain numbers and numbers in the list of arguments.

Work with these examples of the COUNT function in an embedded workbook With a cell selected in the Live result column of the embedded workbook, you can press F2 to see its underlying formula. You can change the formula in the cell or you can copy or edit and then paste the formula to another cell and experiment with it there.

You can download the workbook by clicking the View full-size workbook button in the lower-right corner of the embedded workbook (at the right end of the black bar, above). Clicking the button loads the workbook in a new browser window (or tab, depending on your browser settings). Note that you can't type in the worksheet cells in the full-size browser view.

In full-size browser view, you can then click the Download button

, which enables you to open the

entire workbook in Excel or save it to your computer. For some function examples, opening the workbook in the Excel desktop program allows you to work with array formulas, in which you must press the CTRL+SHIFT+Enter key combination (this combination does not work in the browser).

SQRT function
Show All This article describes the formula syntax and usage of the SQRT function in Microsoft Excel.

Description
Returns a positive square root.

Syntax
SQRT(number)
The SQRT function syntax has the following arguments:

Number Required. The number for which you want the square root.

Remark
If number is negative, SQRT returns the #NUM! error value.

Example
The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? 1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers. 1. 2. 3. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 1. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 Data

2 3

-16 Formula Description (Result) Square root of 16 (4) Square root of the number above. Because the number is negative, an error is returned (#NUM!) Square root of the absolute value of the number above (4)

4 =SQRT(16) 5 =SQRT(A2) 6 =SQRT(ABS(A2))

See Also

STDEV function
Estimates standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed from the average value (the mean).
IMPORTANT This function has been replaced with one or more new functions that may provide improved

accuracy and whose names better reflect their usage. Although this function is still available for backward compatibility, you should consider using the new functions from now on, because this function may not be available in future versions of Excel. For more information about the new function, see STDEV.S function.

Syntax
STDEV(number1,[number2],...])
The STDEV function syntax has the following arguments:

Number1 Required. The first number argument corresponding to a sample of a population. Number2, ... Optional. Number arguments 2 to 255 corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

STDEV assumes that its arguments are a sample of the population. If your data represents the entire population, then compute the standard deviation using STDEVP.

The standard deviation is calculated using the "n-1" method. Arguments can either be numbers or names, arrays, or references that contain numbers. Logical values and text representations of numbers that you type directly into the list of arguments are counted.

If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored.

Arguments that are error values or text that cannot be translated into numbers cause errors. If you want to include logical values and text representations of numbers in a reference as part of the calculation, use the STDEVA function.

STDEV uses the following formula:

where x is the sample mean AVERAGE(number1,number2,) and n is the sample size.

Example
Suppose 10 tools stamped from the same machine during a production run are collected as a random sample and measured for breaking strength. The example may be easier to understand if you copy it to a blank worksheet. How do I copy an example? Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers. 1. 2. 3. Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example. 1. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 7 8 9 10 11 1350 12 13 1303 1299 Formula Description (Result) 1310 1370 1318 1301 1368 1322 Strength 1345

=STDEV(A2:A11)

Standard deviation of breaking strength (27.46392)