Spreadsheet function categories

Some of the content in this topic may not be applicable to some languages.

Show Database

When you need to analyze whether values in a list meet a specific condition, you can use a database spreadsheet function. For example, in a list that contains sales information, you can count all the rows or records in which the sales are greater than 1,000 but less than 2,500.

Some database and list management spreadsheet functions have names that begin with the letter "D." These functions, also known as Dfunctions, have three arguments— database, field, and criteria.

  • The database argument is the range that contains your list. You must include the row that contains the column labels in the range.
  • The field argument is the label for the column you want to summarize.
  • The criteria argument is the range that contains a condition you specify.

Show Date and time

With date and time functions, you can analyze and work with date and time values in formulas. For example, if you need to use the current date in a formula, use the TODAY spreadsheet function, which returns the current date based on your computer's system clock.

Show Financial

Financial functions perform common business calculations, such as determining the payment for a loan, the future value or net present value of an investment, and the values of bonds or coupons.

Common arguments for the financial functions include:

  • Future value (fv)— the value of the investment or loan after all payments have been made.
  • Number of periods (nper)— the total number of payments or periods of an investment.
  • Payment (pmt)— the amount paid periodically to an investment or loan.
  • Present value (pv)— the value of an investment or loan at the beginning of the investment period. For example, the present value of a loan is the principal amount that is borrowed.
  • Rate (rate)— the interest rate or discount rate for a loan or investment.
  • Type (type)— the interval at which payments are made during the payment period, such as at the beginning of a month or the end of the month.

Show Information

Use an information spreadsheet function to determine the type of data stored within a cell. The information functions include a group of spreadsheet functions known as the IS functions that return TRUE if the cell meets a condition. For example, if a cell contains a number, the ISNUMBER spreadsheet function returns TRUE. If you need to determine whether blank cells exist in a range of cells, you can use the COUNTBLANK spreadsheet function to count the number of blank cells in a range of cells, or you can use the ISBLANK spreadsheet function to determine whether one cell in the range is blank.

Show Logical

You can use the logical functions either to see whether a condition is true or false or to check for multiple conditions. For example, you can use the IF function to determine whether a condition is true or false: One value is returned if the condition is true, and a different value is returned if the condition is false.

Show Lookup

When you need to find values in lists or tables or when you need to find the reference of a cell, you can use the lookup and reference spreadsheet functions. For example, to find a value in a table by matching a value in the first column of a table, use the VLOOKUP spreadsheet function. To determine the position of a value in a list, use the MATCH spreadsheet function.

Show Math

With math and trigonometry functions, you can perform simple calculations, such as rounding a number or calculating the total value for a range of cells, or complex calculations, such as calculating the total value for a range of cells that meet a condition in another range of cells.

Show Statistical

Statistical spreadsheet functions perform statistical analysis on ranges of data. For example, a statistical spreadsheet function can provide statistical information about a straight line plotted through a group of values, such as the slope of the line and the y-intercept, or about the actual points that make up the straight line.

Show Text and data

With text functions, you can manipulate text strings in formulas. For example, you can change the case or determine the length of a text string. You can also join, or concatenate, a date to a text string. The following formula is an example of how you can use the TODAY function with the TEXT function to create a message that contains the current date and formats the date in the "dd-mmm-yyyy" number format.

="Budget report as of "&TEXT(TODAY(),"dd-mmm-yyyy")


Use an example in a blank spreadsheet

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.


Show or hide the spreadsheet toolbar

  1. In the design window, make sure the spreadsheet is activated. For instructions, see Help for your design program.
  2. Right-click a cell in the spreadsheet, click Commands and Options on the shortcut menu, and then click the Workbook tab.
  3. Under Show/Hide, select or clear the Toolbar check box.


DAVERAGE

See Also

Averages the values in a column of a list or database that match conditions you specify.

Syntax

DAVERAGE(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DCOUNT

Counts the cells that contain numbers in a column of a list or database that match conditions you specify.

The field argument is optional. If field is omitted, DCOUNT counts all records in the database that match the criteria.

Syntax

DCOUNT(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. If field is omitted, DCOUNT counts all records in the database that match the criteria.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DCOUNTA

Counts all of the nonblank cells in a column of a list or database that match conditions you specify.

The field argument is optional. If field is omitted, DCOUNTA counts all records in the database that match the criteria.

Syntax

DCOUNTA(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. If you omit field, DCOUNTA returns a count of all records that meet the criteria. If you include field, DCOUNTA returns only records that contain a value in the field and meet the criteria.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DGET

Extracts a single value from a column of a list or database that matches conditions you specify.

Syntax

DGET(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Remarks

  • If no record matches the criteria, DGET returns the #VALUE! error value.
  • If more than one record matches the criteria, DGET returns the #NUM! error value.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DMAX

Returns the largest number in a column of a list or database that matches conditions you specify.

Syntax

DMAX(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DMIN

Returns the smallest number in a column of a list or database that matches conditions you specify.

Syntax

DMIN(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DPRODUCT

Multiplies the values in a column of a list or database that match conditions you specify.

Syntax

DPRODUCT(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DSTDEV

Estimates the standard deviation of a population based on a sample by using the numbers in a column of a list or database that match conditions you specify.

Syntax

DSTDEV(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DSTDEVP

Calculates the standard deviation of a population based on the entire population, using the numbers in a column of a list or database that match conditions you specify.

Syntax

DSTDEVP(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DSUM

Adds the numbers in a column of a list or database that match conditions you specify.

Syntax

DSUM(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DVAR

Estimates the variance of a population based on a sample by using the numbers in a column of a list or database that match conditions you specify.

Syntax

DVAR(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


DVARP

Calculates the variance of a population based on the entire population by using the numbers in a column of a list or database that match conditions you specify.

Syntax

DVARP(database,field,criteria)

Database is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Criteria is the range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying a condition for the column.

Show Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |

Show Conditions created as the result of a formula

You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column C greater than the average of cells C7:C10.

=C7>AVERAGE($C$7:$C$10)

Notes

  • The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "C7" refers to the field (column C) for the first record (row 7) of the list.

  • You can use a column label in the formula instead of a relative cell reference or a range name. When an error value is displayed such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

  • When evaluating data, there is no distinction between uppercase and lowercase characters.


Example for database functions

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Tree | Height | Age | Yield | Profit | Height
Apple | >10 |  |  |  | <16
Pear |  |  |  |  |
Tree | Height | Age | Yield | Profit
Apple | 18 | 20 | 14 | 105.00
Pear | 12 | 12 | 10 | 96.00
Cherry | 13 | 14 | 9 | 105.00
Apple | 14 | 15 | 10 | 75.00
Pear | 9 | 8 | 8 | 76.80
Apple | 8 | 9 | 6 | 45.00
Formula | Description (Result)
=DCOUNT(A4:E10,"Age",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)
=DCOUNTA(A4:E10,"Profit",A1:F2) | This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Profit fields in those records are not blank. (1)
=DMAX(A4:E10,"Profit",A1:A3) | The maximum profit of apple and pear trees. (105)
=DMIN(A4:E10,"Profit",A1:B2) | The minimum profit of apple trees over 10 in height. (75)
=DSUM(A4:E10,"Profit",A1:A2) | The total profit from apple trees. (225)
=DSUM(A4:E10,"Profit",A1:F2) | The total profit from apple trees with a height between 10 and 16. (75)
=DPRODUCT(A4:E10,"Yield",A1:B2) | The product of the yields from apple trees with a height greater than 10. (140)
=DAVERAGE(A4:E10,"Yield",A1:B2) | The average yield of apple trees over 10 feet in height. (12)
=DAVERAGE(A4:E10,3,A4:E10) | The average age of all trees in the database. (13)
=DSTDEV(A4:E10,"Yield",A1:A3) | The estimated standard deviation in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (2.97)
=DSTDEVP(A4:E10,"Yield",A1:A3) | The true standard deviation in the yield of apple and pear trees if the data in the database is the entire population. (2.65)
=DVAR(A4:E10,"Yield",A1:A3) | The estimated variance in the yield of apple and pear trees if the data in the database is only a sample of the total orchard population. (8.8)
=DVARP(A4:E10,"Yield",A1:A3) | The true variance in the yield of apple and pear trees if the data in the database is the entire orchard population. (7.04)
=DGET(A4:E10,"Yield",A1:A3) | Returns the #NUM! error value because more than one record meets the criteria.

Show Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount 10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • In most cases, your criteria range should not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

Show Examples of criteria

Show Multiple conditions in a single column

If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column.

Salesperson
Davolio
Buchanan
Suyama

Show One condition in two or more columns

To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type | Salesperson | Sales
Produce | Davolio | >1000

Show One condition in one column or another

To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type | Salesperson | Sales
Produce |  |
 | Davolio |
 |  | >1000

Show One of two sets of conditions for two columns

To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Salesperson | Sales
Davolio | >3000
Buchanan | >1500

Show More than two sets of conditions for one column

To find rows that meet greater than two sets of conditions, include multiple columns with the same column heading. For example, the following criteria range displays sales that are between 5,000 and 8,000 in addition to sales that are less than 500.

Sales | Sales
>5000 | <8000
<500 |


DATE

Returns the sequential serial number that represents a particular date.

Syntax

DATE(year,month,day)

Year The year argument can be one to four digits.

  • If year is between 0 (zero) and 1899 (inclusive), the value is added to 1900 to calculate the year. For example, DATE(108,1,2) returns January 2, 2008 (1900+108).

  • If year is between 1900 and 9999 (inclusive), the value is used as the year. For example, DATE(2008,1,2) returns January 2, 2008.

Month is a number representing the month of the year. If month is greater than 12, month adds that number of months to the first month in the year specified. For example, DATE(2008,14,2) returns the serial number representing February 2, 2009.

Day is a number representing the day of the month. If day is greater than the number of days in the month specified, day adds that number of days to the first day in the month. For example, DATE(2008,1,35) returns the serial number representing February 4, 2008.

Remarks

  • Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.
  • The DATE function is most useful in formulas where year, month, and day are formulas, not constants.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Year | Month | Day
2008 | 1 | 1
Formula | Description (Result)
=DATE(A2,B2,C2) | Serial date for the date above (1/1/2008 or 39448)

Note If you want to change the display of the result from a serial number to a date format or vice versa, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the format you want in the Number Format box. To view the date as a serial number, apply the General number format.


DATEVALUE

Returns the serial number of the date represented by date_text. Use DATEVALUE to convert a date represented by text to a serial number.

Syntax

DATEVALUE(date_text)

Date_text is text that represents a date in a date format. For example, "1/30/2008" or "30-Jan-2008" are text strings within quotation marks that represent dates.

If the year portion of date_text is omitted, DATEVALUE uses the current year from your computer's built-in clock. Time information in date_text is ignored.

Remarks

  • Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.
  • Most functions automatically convert date values to serial numbers.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=DATEVALUE("8/22/2008") | Serial number of the text date (39682)
=DATEVALUE("22-AUG-2008") | Serial number of the text date (39682)
=DATEVALUE("2008/02/23") | Serial number of the text date (39501)
=DATEVALUE("5-JUL") | Serial number of the text date, assuming the computer's built-in clock is set to 2000 (36712)

Note If you want to change the display of the result from a serial number to a date format or vice versa, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the format you want in the Number Format box. To view the date as a serial number, apply the General number format.


DAY

Returns the day of a date, represented by a serial number. The day is given as an integer ranging from 1 to 31.

Syntax

DAY(serial_number)

Serial_number is the date of the day you are trying to find.

Remarks

  • 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. The #VALUE! error may be returned if dates are entered as text.

  • Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.
  • Values returned by the YEAR, MONTH and DAY functions will be Gregorian values regardless of the display format for the supplied date value. For example, if the display format of the supplied date is Hijri, the returned values for the YEAR, MONTH and DAY functions will be values associated with the equivalent Gregorian date.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Date
15-Apr-2008
Formula | Description (Result)
=DAY(A2) | Day of the date above (15)


DAYS360

Returns the number of days between two dates based on a 360-day year (twelve 30-day months), which is used in some accounting calculations. Use this function to help compute payments if your accounting system is based on twelve 30-day months.

Syntax

DAYS360(start_date,end_date,method)

Start_date and end_date are the two dates between which you want to know the number of days. If start_date occurs after end_date, DAYS360 returns a negative number. 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.

Method is a logical value that specifies whether to use the U.S. or European method in the calculation.

Method | Defined
FALSE or omitted | U.S. (NASD) method. If the starting date is the 31st of a month, it becomes equal to the 30th of the same month. If the ending date is the 31st of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1st of the next month; otherwise the ending date becomes equal to the 30th of the same month.
TRUE | European method. Starting dates and ending dates that occur on the 31st of a month become equal to the 30th of the same month.

Remark

Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Dates
1/30/2008
2/1/2008
Formula | Description (Result)
=DAYS360(A2,A3) | Number of days between the two dates above, based on a 360-day year (1)


HOUR

Returns the hour of a time value. The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).

Syntax

HOUR(serial_number)

Serial_number is the time that contains the hour you want to find. Times may be entered as text strings within quotation marks (for example, "6:45 PM"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE("6:45 PM")).

Remark

Time values are a portion of a date value and represented by a decimal number (for example, 12:00 PM is represented as 0.5 because it is half of a day).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Time
3:30:30 AM
3:30:30 PM
15:30
Formula | Description (Result)
=HOUR(A2) | Hour of first time (3)
=HOUR(A3) | Hour of second time (15)
=HOUR(A4) | Hour of third time (15)


MINUTE

Returns the minutes of a time value. The minute is given as an integer, ranging from 0 to 59.

Syntax

MINUTE(serial_number)

Serial_number is the time that contains the minute you want to find. Times may be entered as text strings within quotation marks (for example, "6:45 PM"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE("6:45 PM")).

Remarks

Time values are a portion of a date value and represented by a decimal number (for example, 12:00 PM is represented as 0.5, since it is half of a day).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Time
4:48:00 PM
Formula | Description (Result)
=MINUTE(A2) | Minutes of the time above (48)


MONTH

Returns the month of a date represented by a serial number. The month is given as an integer, ranging from 1 (January) to 12 (December).

Syntax

MONTH(serial_number)

Serial_number is the date of the month 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.

Remarks

Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Values returned by the YEAR, MONTH and DAY functions will be Gregorian values regardless of the display format for the supplied date value. For example, if the display format of the supplied date is Hijri, the returned values for the YEAR, MONTH and DAY functions will be values associated with the equivalent Gregorian date.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Date
15-Apr-2008
Formula | Description (Result)
=MONTH(A2) | Month of the date above (4)


NOW

Returns the serial number of the current date and time.

Syntax

NOW( )

Remarks

  • Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.
  • Numbers to the right of the decimal point in the serial number represent the time; numbers to the left represent the date. For example, the serial number .5 represents the time 12:00 noon.
  • The NOW function changes only when the sheet is calculated. It is not updated continuously.

Note If you want to change the display of the result from a serial number to a date format or vice versa, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the format you want in the Number Format box. To view the date as a serial number, apply the General number format.


SECOND

Returns the seconds of a time value. The second is given as an integer in the range 0 (zero) to 59.

Syntax

SECOND(serial_number)

Serial_number is the time that contains the seconds you want to find. Times may be entered as text strings within quotation marks (for example, "6:45 PM"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE("6:45 PM")).

Remark

Time values are a portion of a date value and represented by a decimal number (for example, 12:00 PM is represented as 0.5 because it is half of a day).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Time
4:48:18 PM
4:48 PM
Formula | Description
=SECOND(A2) | Seconds in the first time (18)
=SECOND(A3) | Seconds in the second time (0)


TIME

Returns the decimal number for a particular time. The decimal number returned by TIME is a value ranging from 0 (zero) to 0.99999999, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.).

Syntax

TIME(hour,minute,second)

Hour is a number from 0 (zero) to 32767 representing the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value. For example, TIME(27,0,0) = TIME(3,0,0) = .125 or 3:00 AM.

Minute is a number from 0 to 32767 representing the minute. Any value greater than 59 will be converted to hours and minutes. For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.

Second is a number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM

Remark

Time values are a portion of a date value and represented by a decimal number (for example, 12:00 PM is represented as 0.5 because it is half of a day).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Hour | Minute | Second
12 | 0 | 0
16 | 48 | 10
Formula | Description (Result)
=TIME(A2,B2,C2) | Decimal representation of the time of day, for the first time above (0.5)
=TIME(A3,B3,C3) | Decimal representation of the time of day, for the second time above (0.700115741)

Note To view the time as a decimal number, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the General number format.


TIMEVALUE

Returns the decimal number of the time represented by a text string. The decimal number is a value ranging from 0 (zero) to 0.99999999, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.).

Syntax

TIMEVALUE(time_text)

Time_text is a text string that represents a time in any one of the spreadsheet time formats; for example, "6:45 PM" and "18:45" text strings within quotation marks that represent time.

Remarks

  • Date information in time_text is ignored.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=TIMEVALUE("2:24 AM") | Decimal part of a day, for the time (0.1)
=TIMEVALUE("22-Aug-2008 6:35 AM") | Decimal part of a day, for the time (0.274305556)

Note If you want to change the display of the result from a serial number to a time format or vice versa, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the format you want in the Number Format box. To view the date as a serial number, apply the General number format.


TODAY

Returns the serial number of the current date. The serial number is the date-time code used by the spreadsheet for date and time calculations.

Syntax

TODAY( )

Remark

Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Note If you want to change the display of the result from a serial number to a date format or vice versa, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the format you want in the Number Format box. To view the date as a serial number, apply the General number format.


WEEKDAY

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)

Serial_number is 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 is a number that determines the type of return value.

Return_type | Number returned
1 or omitted | Numbers 1 (Sunday) through 7 (Saturday).
2 | Numbers 1 (Monday) through 7 (Sunday).
3 | Numbers 0 (Monday) through 6 (Sunday).

Remark

Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
2/14/2008
Formula | Description (Result)
=WEEKDAY(A2) | Day of the week, with numbers 1 (Sunday) through 7 (Saturday) (5)
=WEEKDAY(A2,2) | Day of the week, with numbers 1 (Monday) through 7 (Sunday) (4)
=WEEKDAY(A2,3) | Day of the week, with numbers 0 (Monday) through 6 (Sunday) (3)

Note 2/14/2008 is a Thursday.


YEAR

Returns the year corresponding to a date.

Syntax

YEAR(serial_number)

Serial_number is the date of the year you want 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.

Remarks

Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Values returned by the YEAR, MONTH and DAY functions will be Gregorian values regardless of the display format for the supplied date value. For example, if the display format of the supplied date is Hijri, the returned values for the YEAR, MONTH and DAY functions will be values associated with the equivalent Gregorian date.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Date
7/5/2008
7/5/10
Formula | Description (Result)
=YEAR(A2) | Year of the first date (2008)
=YEAR(A3) | Year of the second date (2010)


DB

Returns the depreciation of an asset for a specified period using the fixed-declining balance method.

Syntax

DB(cost,salvage,life,period,month)

Cost is the initial cost of the asset.

Salvage is the value at the end of the depreciation (sometimes called the salvage value of the asset).

Life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).

Period is the period for which you want to calculate the depreciation. Period must use the same units as life.

Month is the number of months in the first year. If month is omitted, it is assumed to be 12.

Remarks

  • The fixed-declining balance method computes depreciation at a fixed rate. DB uses the following formulas to calculate depreciation for a period:

    (cost - total depreciation from prior periods) * rate

    where:

    rate = 1 - ((salvage / cost) ^ (1 / life)), rounded to three decimal places

  • Depreciation for the first and last periods is a special case. For the first period, DB uses this formula:

    cost * rate * month / 12

  • For the last period, DB uses this formula:

    ((cost - total depreciation from prior periods) * rate * (12 - month)) / 12

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
1,000,000 | Initial cost
100,000 | Salvage value
6 | Lifetime in years
Formula | Description (Result)
=DB(A2,A3,A4,1,7) | Depreciation in first year, with only 7 months calculated (186,083.33)
=DB(A2,A3,A4,2,7) | Depreciation in second year (259,639.42)
=DB(A2,A3,A4,3,7) | Depreciation in third year (176,814.44)
=DB(A2,A3,A4,4,7) | Depreciation in fourth year (120,410.64)
=DB(A2,A3,A4,5,7) | Depreciation in fifth year (81,999.64)
=DB(A2,A3,A4,6,7) | Depreciation in sixth year (55,841.76)
=DB(A2,A3,A4,7,7) | Depreciation in seventh year, with only 5 months calculated (15,845.10)


DDB

Returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify.

Syntax

DDB(cost,salvage,life,period,factor)

Cost is the initial cost of the asset.

Salvage is the value at the end of the depreciation (sometimes called the salvage value of the asset).

Life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).

Period is the period for which you want to calculate the depreciation. Period must use the same units as life.

Factor is the rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).

All five arguments must be positive numbers.

Remarks

  • The double-declining balance method computes depreciation at an accelerated rate. Depreciation is highest in the first period and decreases in successive periods. DDB uses the following formula to calculate depreciation for a period:

    ((cost-salvage) - total depreciation from prior periods) * (factor/life)

  • Change factor if you do not want to use the double-declining balance method.
  • Use the VDB function if you want to switch to the straight-line depreciation method when depreciation is greater than the declining balance calculation.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
2400 | Initial cost
300 | Salvage value
10 | Lifetime in years
Formula | Description (Result)
=DDB(A2,A3,A4*365,1) | First day's depreciation. Factor is automatically assumed to be 2. (1.32)
=DDB(A2,A3,A4*12,1,2) | First month's depreciation (40.00)
=DDB(A2,A3,A4,1,2) | First year's depreciation (480.00)
=DDB(A2,A3,A4,2,1.5) | Second year's depreciation using a factor of 1.5 instead of the double-declining balance method (306.00)
=DDB(A2,A3,A4,10) | Tenth year's depreciation. Factor is automatically assumed to be 2 (22.12)

Note The results are rounded to two decimal places.


EUROCONVERT

Some of the content in this topic may not be applicable to some languages.

Converts a number to euros, converts a number from euros to a euro member currency, or converts a number from one euro member currency to another by using the euro as an intermediary (triangulation). The currencies available for conversion are those of European Union (EU) members that have adopted the euro. The function uses fixed conversion rates that are established by the EU.

Syntax

EUROCONVERT(number,source,target,full_precision,triangulation_precision)

Number is the currency value you want to convert, or a reference to a cell containing the value.

Source is a three-letter string, or reference to a cell containing the string, corresponding to the International Organization for Standardization (ISO) code for the source currency. The following currency codes are available in the EUROCONVERT function:

Country/Region | Basic unit of currency | ISO code
Belgium | franc | BEF
Luxembourg | franc | LUF
Germany | deutsche mark | DEM
Spain | peseta | ESP
France | franc | FRF
Ireland | pound | IEP
Italy | lira | ITL
Netherlands | guilder | NLG
Austria | schilling | ATS
Portugal | escudo | PTE
Finland | markka | FIM
Euro member states | euro | EUR

Target is a three-letter string, or cell reference, corresponding to the ISO code of the currency to which you want to convert the number. See the previous Source table for the ISO codes.

Full_precision is a logical value (TRUE or FALSE), or an expression that evaluates to a value of TRUE or FALSE, that specifies how to display the result.

Use | If you want to
FALSE | Display the result with the currency-specific rounding rules (see the table that follows).The calculation precision value is used to calculate the result and the display precision value to display the result. FALSE is the default if the full_precision argument is omitted.
TRUE | Display the result with all significant digits resulting from the calculation.

The following table shows the currency specific rounding rules, that is, how many decimal places are used to calculate a currency's conversion and display the result.

ISO code | Calculation precision | Display precision
BEF | 0 | 0
LUF | 0 | 0
DEM | 2 | 2
ESP | 0 | 0
FRF | 2 | 2
IEP | 2 | 2
ITL | 0 | 0
NLG | 2 | 2
ATS | 2 | 2
PTE | 1 | 2
FIM | 2 | 2
EUR | 2 | 2

Triangulation_precision is an integer equal to or greater than 3 that specifies the number of significant digits to be used for the intermediate euro value when converting between two euro member currencies. If you omit this argument, the intermediate euro value is not rounded. If you include this argument when converting from a euro member currency to the euro, the spreadsheet calculates the intermediate euro value that could then be converted to a euro member currency.

Remarks

  • Trailing zeros in the return value are truncated.
  • If the source ISO code is the same as the target ISO code, the original value of the number is returned.
  • Invalid parameters return #VALUE.
  • This function does not apply a number format.

Examples

These examples assume conversion rates of 1 euro = 6.55957 French francs and 1.95583 deutsche marks. The EUROCONVERT function uses the current rates established by the EU. Microsoft will update the function if the rates change. To get full information about the rules and the rates currently in effect, see the European Union publications about the euro.

The examples show the resulting value stored in the cell, not the formatted value.

EUROCONVERT(1.20,"DEM","EUR") equals 0.61 euro. Because neither full_precision nor triangulation_precision are specified, the result uses the calculation precision for the euro, which is 2 decimal places.

EUROCONVERT(1,"FRF","EUR",TRUE,3) equals 0.152 euro. When converting to euros, if full_precision is TRUE, the result has the precision specified by triangulation_precision.

EUROCONVERT(1,"FRF","EUR",FALSE,3) equals 0.15 euro. When converting to euros, if full_precision is FALSE, the result uses the calculation precision for the euro, which is 2 decimal places.

EUROCONVERT(1,"FRF","DEM",TRUE,3) equals 0.29728616 DM. Because triangulation_precision is 3, the intermediate euro value is rounded to three places. Because full_precision is TRUE, the resulting deutsche mark value is stored with all significant digits.

EUROCONVERT(1,"FRF","DEM",FALSE,3) equals 0.30 DM. Because triangulation_precision is 3, the intermediate euro value is rounded to three places. Because full_precision is FALSE, the resulting deutsche mark value is rounded to the calculation precision for the deutsche mark, which is 2 decimal places.


FV

Returns the future value of an investment based on periodic, constant payments and a constant interest rate.

Syntax

FV(rate,nper,pmt,pv,type)

For a more complete description of the arguments in FV and for more information on annuity functions, see PV.

Rate is the interest rate per period.

Nper is the total number of payment periods in an annuity.

Pmt is the payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.

Pv is the present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.

Type is the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.

Set type equal to | If payments are due
0 | At the end of the period
1 | At the beginning of the period

Remarks
  • 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 12 percent annual interest, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper.
  • For all the arguments, cash you pay out, such as deposits to savings, is represented by negative numbers; cash you receive, such as dividend checks, is represented by positive numbers.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
6% | Annual interest rate
10 | Number of payments
-200 | Amount of the payment
-500 | Present value
1 | Payment is due at the beginning of the period (see above)
Formula | Description (Result)
=FV(A2/12, A3, A4, A5, A6) | Future value of an investment with the above terms (2581.40)

Note The annual interest rate is divided by 12 because it is compounded monthly.

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
12% | Annual interest rate
12 | Number of payments
-1000 | Amount of the payment
Formula | Description (Result)
=FV(A2/12, A3, A4) | Future value of an investment with the above terms (12,682.50)

Note The annual interest rate is divided by 12 because it is compounded monthly.


IPMT

Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. For a more complete description of the arguments in IPMT and for more information about annuity functions, see PV.

Syntax

IPMT(rate,per,nper,pv,fv,type)

Rate is the interest rate per period.

Per is the period for which you want to find the interest and must be in the range 1 to nper.

Nper is the total number of payment periods in an annuity.

Pv is the present value, or the lump-sum amount that a series of future payments is worth right now.

Fv is 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 (the future value of a loan, for example, is 0).

Type is the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.

Set type equal to | If payments are due
0 | At the end of the period
1 | At the beginning of the period

Remarks
  • 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 12 percent annual interest, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper.
  • For all the arguments, cash you pay out, such as deposits to savings, is represented by negative numbers; cash you receive, such as dividend checks, is represented by positive numbers.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
10% | Annual interest
1 | Period for which you want to find the interest
3 | Years of loan
8000 | Present value of loan
Formula | Description (Result)
=IPMT(A2/12, A3*3, A4, A5) | Interest due in the first month for a loan with the terms above (-22.41)
=IPMT(A2, 3, A4, A5) | Interest due in the last year for a loan with the terms above, where payments are made yearly (-292.45)

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


IRR

Returns the internal rate of return for a series of cash flows represented by the numbers in values. These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received for an investment consisting of payments (negative values) and income (positive values) that occur at regular periods.

Syntax

IRR(values,guess)

Values is an array or a reference to cells that contain numbers for which you want to calculate the internal rate of return.

  • Values must contain at least one positive value and one negative value to calculate the internal rate of return.
  • IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored.

Guess is a number that you guess is close to the result of IRR.

  • An iterative technique is used to calculate IRR. Starting with guess, IRR cycles through the calculation until the result is accurate within 0.00001 percent. If IRR can't find a result that works after 20 tries, the #NUM! error value is returned.
  • In most cases you do not need to provide guess for the IRR calculation. If guess is omitted, it is assumed to be 0.1 (10 percent).
  • If IRR gives the #NUM! error value, or if the result is not close to what you expected, try again with a different value for guess.

Remarks

IRR is closely related to NPV, the net present value function. The rate of return calculated by IRR is the interest rate corresponding to a 0 (zero) net present value. The following formula demonstrates how NPV and IRR are related:

NPV(IRR(B1:B6),B1:B6) equals 3.60E-08 [Within the accuracy of the IRR calculation, the value 3.60E-08 is effectively 0 (zero).]

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
-70,000 | Initial cost of a business
12,000 | Net income for the first five years
15,000 | Net income for the first five years
18,000 | Net income for the first five years
21,000 | Net income for the first five years
26,000 | Net income for the first five years
Formula | Description (Result)
=IRR(A2:A6) | Investment's internal rate of return after four years (-2%)
=IRR(A2:A7) | Internal rate of return after five years (9%)
=IRR(A2:A4,-10%) | To calculate the internal rate of return after two years, you need to include a guess (-44%)


ISPMT

Calculates the interest paid during a specific period of an investment. This function is provided for compatibility with Lotus 1-2-3.

Syntax

ISPMT(rate,per,nper,pv)

Rate is the interest rate for the investment.

Per is the period for which you want to find the interest, and must be between 1 and nper.

Nper is the total number of payment periods for the investment.

Pv is the present value of the investment. For a loan, pv is the loan amount.

Remarks

  • 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% for rate and 4 for nper.
  • For all the arguments, the cash you pay out, such as deposits to savings or other withdrawals, is represented by negative numbers; the cash you receive, such as dividend checks and other deposits, is represented by positive numbers.
  • For additional information about financial functions, see the PV function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
10% | Annual interest rate
1 | Period
3 | Number of years in the investment
8000000 | Amount of loan
Formula | Description (Result)
=ISPMT(A2/12,A3,A4*12,A5) | Interest paid for the first monthly payment of a loan with the above terms (-64814.8)
=ISPMT(A2,1,A4,A5) | Interest paid in the first year of a loan with the above terms (-533333)

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


MIRR

Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both the cost of the investment and the interest received on reinvestment of cash.

Syntax

MIRR(values,finance_rate,reinvest_rate)

Values is an array or a reference to cells that contain numbers. These numbers represent a series of payments (negative values) and income (positive values) occurring at regular periods.

  • Values must contain at least one positive value and one negative value to calculate the modified internal rate of return. Otherwise, MIRR returns the #DIV/0! error value.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.

Finance_rate is the interest rate you pay on the money used in the cash flows.

Reinvest_rate is the interest rate you receive on the cash flows as you reinvest them.

Remarks

  • MIRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want and with the correct signs (positive values for cash received, negative values for cash paid).
  • If n is the number of cash flows in values, frate is the finance_rate, and rrate is the reinvest_rate, then the formula for MIRR is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
-$120,000 | Initial cost
39,000 | Return first year
30,000 | Return second year
21,000 | Return third year
37,000 | Return fourth year
46,000 | Return fifth year
10.00% | Annual interest rate for the 120,000 loan
12.00% | Annual interest rate for the reinvested profits
Formula | Description (Result)
=MIRR(A2:A7, A8, A9) | Investment's modified rate of return after five years (13%)
=MIRR(A2:A5, A8, A9) | Modified rate of return after three years (-5%)
=MIRR(A2:A7, A8, 14%) | Five-year modified rate of return based on a reinvest_rate of 14 percent (13%)


NPER

Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.

Syntax

NPER(rate, pmt, pv, fv, type)

For a more complete description of the arguments in NPER and for more information about annuity functions, see PV.

Rate is the interest rate per period.

Pmt is the payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.

Pv is the present value, or the lump-sum amount that a series of future payments is worth right now.

Fv is 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 (the future value of a loan, for example, is 0).

Type is the number 0 or 1 and indicates when payments are due.

Set type equal to | If payments are due
0 or omitted | At the end of the period
1 | At the beginning of the period

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
12% | Annual interest rate
-100 | Payment made each period
-1000 | Present value
10000 | Future value
1 | Payment is due at the beginning of the period (see above)
Formula | Description (Result)
=NPER(A2/12, A3, A4, A5, 1) | Periods for the investment with the above terms (60)
=NPER(A2/12, A3, A4, A5) | Periods for the investment with the above terms, except payments are made at the beginning of the period (60)
=NPER(A2/12, A3, A4) | Periods for the investment with the above terms, except with a future value of 0 (-9.578)


NPV

Calculates the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values).

Syntax

NPV(rate,value1,value2, ...)

Rate is the rate of discount over the length of one period.

Value1, value2, ... are 1 to 29 arguments representing the payments and income.

  • Value1, value2, ... must be equally spaced in time and occur at the end of each period.
  • NPV uses the order of value1, value2, ... to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence.
  • Arguments that are numbers, empty cells, logical values, or text representations of numbers are counted; arguments that are error values or text that cannot be translated into numbers are ignored.
  • 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.

Remarks

  • The NPV investment begins one period before the date of the value1 cash flow and ends with the last cash flow in the list. The NPV calculation is based on future cash flows. If your first cash flow occurs at the beginning of the first period, the first value must be added to the NPV result, not included in the values arguments. For more information, see the examples below.
  • If n is the number of cash flows in the list of values, the formula for NPV is:

  • NPV is similar to the PV function (present value). The primary difference between PV and NPV is that PV allows cash flows to begin either at the end or at the beginning of the period. Unlike the variable NPV cash flow values, PV cash flows must be constant throughout the investment. For information about annuities and financial functions, see PV.
  • NPV is also related to the IRR function (internal rate of return). IRR is the rate for which NPV equals zero: NPV(IRR(...), ...) = 0.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
10% | Annual discount rate
-10,000 | Initial cost of investment one year from today
3,000 | Return from first year
4,200 | Return from second year
6,800 | Return from third year
Formula | Description (Result)
=NPV(A2, A3, A4, A5, A6) | Net present value of this investment (1,188.44)

In the preceding example, you include the initial $10,000 cost as one of the values, because the payment occurs at the end of the first period.

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
8% | Annual discount rate. This might represent the rate of inflation or the interest rate of a competing investment.
-40,000 | Initial cost of investment
8,000 | Return from first year
9,200 | Return from second year
10,000 | Return from third year
12,000 | Return from fourth year
14,500 | Return from fifth year
Formula | Description (Result)
=NPV(A2, A4:A8)+A3 | Net present value of this investment (1,922.06)
=NPV(A2, A4:A8, -9000)+A3 | Net present value of this investment, with a loss in the sixth year of 9000 (-3,749.47)

In the preceding example, you don't include the initial $40,000 cost as one of the values, because the payment occurs at the beginning of the first period.


PMT

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

Syntax

PMT(rate,nper,pv,fv,type)

For a more complete description of the arguments in PMT, see the PV function.

Rate is the interest rate for the loan.

Nper is the total number of payments for the loan.

Pv is the present value, or the total amount that a series of future payments is worth now; also known as the principal.

Fv is 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 is the number 0 (zero) or 1 and indicates when payments are due.

Set type equal to | If payments are due
0 or omitted | At the end of the period
1 | 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.

Show Tip

To find the total amount paid over the duration of the loan, multiply the returned PMT value by nper.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
8% | Annual interest rate
10 | Number of months of payments
10000 | Amount of loan
Formula | Description (Result)
=PMT(A2/12, A3, A4) | Monthly payment for a loan with the above terms (-1,037.03)
=PMT(A2/12, A3, A4, 0, 1) | Monthly payment for a loan with the above terms, except payments are due at the beginning of the period (-1,030.16)

Example 2

You can use PMT to determine payments to annuities other than loans.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
6% | Annual interest rate
18 | Years you plan on saving
50,000 | Amount you want to have save in 18 years
Formula | Description (Result)
=PMT(A2/12, A3*12, 0, A4) | Amount to save each month to have 50,000 at the end of 18 years (-129.08)

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


PPMT

Returns the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate.

Syntax

PPMT(rate,per,nper,pv,fv,type)

For a more complete description of the arguments in PPMT, see PV.

Rate is the interest rate per period.

Per specifies the period and must be in the range 1 to nper.

Nper is the total number of payment periods in an annuity.

Pv is the present value— the total amount that a series of future payments is worth now.

Fv is 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 is the number 0 or 1 and indicates when payments are due.

Set type equal to | If payments are due
0 or omitted | At the end of the period
1 | At the beginning of the period

Remark

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 12 percent annual interest, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description (Result)
10% | Annual interest rate
2 | Number of years in the loan
2000 | Amount of loan
Formula | Description (Result)
=PPMT(A2/12, 1, A3*12, A4) | Payment on principle for the first month of loan (-75.62)

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

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description (Result)
8% | Annual interest rate
10 | Number of years in the loan
200,000 | Amount of loan
Formula | Description (Result)
=PPMT(A2, A3, 10, A4) | Principal payment for the last year of the loan with the above terms (-27,598.05)


PV

Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender.

Syntax

PV(rate,nper,pmt,fv,type)

Rate is the interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate.

Nper is the total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper.

Pmt is the payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument.

Fv is 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 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument.

Type is the number 0 or 1 and indicates when payments are due.

Set type equal to | If payments are due
0 or omitted | At the end of the period
1 | At the beginning of the period

Remarks
  • 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 12 percent annual interest, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper.
  • The following functions apply to annuities:
    PPMT
    PV
    FV
    IPMT
    PMT
    RATE

    An annuity is a series of constant cash payments made over a continuous period. For example, a car loan or a mortgage is an annuity. For more information, see the description for each annuity function.
  • In annuity functions, cash you pay out, such as a deposit to savings, is represented by a negative number; cash you receive, such as a dividend check, is represented by a positive number. For example, a $1,000 deposit to the bank would be represented by the argument -1000 if you are the depositor and by the argument 1000 if you are the bank.
  • One financial argument is solved in terms of the others. If rate is not 0, then:

    If rate is 0, then:

    (pmt * nper) + pv + fv = 0

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
500 | Money paid out of an insurance annuity at the end of every month
8% | Interest rate earned on the money paid out
20 | Years the money will be paid out
Formula | Description (Result)
=PV(A3/12, 12*A4, A2, , 0) | Present value of an annuity with the terms above (-59,777.15).

The result is negative because it represents money that you would pay, an outgoing cash flow. If you are asked to pay (60,000) for the annuity, you would determine this would not be a good investment because the present value of the annuity (59,777.15) is less than what you are asked to pay.

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


RATE

Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions. If the successive results of RATE do not converge to within 0.0000001 after 20 iterations, RATE returns the #NUM! error value.

Syntax

RATE(nper,pmt,pv,fv,type,guess)

For a complete description of the arguments nper, pmt, pv, fv, and type, see PV.

Nper is the total number of payment periods in an annuity.

Pmt is the payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument.

Pv is the present value— the total amount that a series of future payments is worth now.

Fv is 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 (the future value of a loan, for example, is 0).

Type is the number 0 or 1 and indicates when payments are due.

Set type equal to | If payments are due
0 or omitted | At the end of the period
1 | At the beginning of the period

Guess is your guess for what the rate will be.

  • If you omit guess, it is assumed to be 10 percent.
  • If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.

Remark

Make sure that you are consistent about the units you use for specifying guess and nper. If you make monthly payments on a four-year loan at 12 percent annual interest, use 12%/12 for guess and 4*12 for nper. If you make annual payments on the same loan, use 12% for guess and 4 for nper.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
4 | Years of the loan
-200 | Monthly payment
8000 | Amount of the loan
Formula | Description (Result)
=RATE(A2*12, A3, A4) | Monthly rate of the loan with the above terms (1%)
=RATE(A2*12, A3, A4)*12 | Annual rate of the loan with the above terms (0.09241767 or 9.24%)

Note The years of the loan is multiplied by 12 to get the number of months.


SLN

Returns the straight-line depreciation of an asset for one period.

Syntax

SLN(cost,salvage,life)

Cost is the initial cost of the asset.

Salvage is the value at the end of the depreciation (sometimes called the salvage value of the asset).

Life is the number of periods over which the asset is depreciated (sometimes called the useful life of the asset).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
30,000 | Cost
7,500 | Salvage value
10 | Years of useful life
Formula | Description (Result)
=SLN(A2, A3, A4) | The depreciation allowance for each year (2,250)


SYD

Returns the sum-of-years' digits depreciation of an asset for a specified period.

Syntax

SYD(cost,salvage,life,per)

Cost is the initial cost of the asset.

Salvage is the value at the end of the depreciation (sometimes called the salvage value of the asset).

Life is the number of periods over which the asset is depreciated (sometimes called the useful life of the asset).

Per is the period and must use the same units as life.

Remark

  • SYD is calculated as follows:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
30000 | Initial cost
7500 | Salvage value
10 | Lifespan in years
Formula | Description (Result)
=SYD(A2,A3,A4,1) | Yearly depreciation allowance for the first year (4,090.91)
=SYD(A2,A3,A4,10) | Yearly depreciation allowance for the tenth year (409.09)


VDB

Returns the depreciation of an asset for any period you specify, including partial periods, using the double-declining balance method or some other method you specify. VDB stands for variable declining balance.

Syntax

VDB(cost,salvage,life,start_period,end_period,factor,no_switch)

Cost is the initial cost of the asset.

Salvage is the value at the end of the depreciation (sometimes called the salvage value of the asset).

Life is the number of periods over which the asset is depreciated (sometimes called the useful life of the asset).

Start_period is the starting period for which you want to calculate the depreciation. Start_period must use the same units as life.

End_period is the ending period for which you want to calculate the depreciation. End_period must use the same units as life.

Factor is the rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method). Change factor if you do not want to use the double-declining balance method. For a description of the double-declining balance method, see DDB.

No_switch is a logical value specifying whether to switch to straight-line depreciation when depreciation is greater than the declining balance calculation.

  • If no_switch is TRUE, the switch to straight-line depreciation is not done even when the depreciation is greater than the declining balance calculation.
  • If no_switch is FALSE or omitted, switch to straight-line depreciation when depreciation is greater than the declining balance calculation.

All arguments except no_switch must be positive numbers.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
2400 | Initial cost
300 | Salvage value
10 | Lifetime in years
Formula | Description (Result)
=VDB(A2, A3, A4*365, 0, 1) | First day's depreciation. Assumes that factor is 2 (1.32)
=VDB(A2, A3, A4*12, 0, 1) | First month's depreciation (40.00)
=VDB(A2, A3, A4, 0, 1) | First year's depreciation (480.00)
=VDB(A2, A3, A4*12, 6, 18) | Depreciation between the sixth month and the eighteenth month (396.31)
=VDB(A2, A3, A4*12, 6, 18, 1.5) | Depreciation between the sixth month and the eighteenth month using a factor of 1.5 instead of the double-declining balance method (311.81)
=VDB(A2, A3, A4, 0, 0.875, 1.5) | Depreciation for the first fiscal year that you own the asset, assuming that tax laws limit you to 150-percent depreciation of the declining balance. Asset is purchased in the middle of the first quarter of the fiscal year. (315.00)

Note The results are rounded to two decimal places.


CELL

Returns information about the formatting, location, or contents of the upper-left cell in a reference.

Syntax

CELL(info_type,reference)

Info_type is a text value that specifies what type of cell information you want. The following list shows the possible values of info_type and the corresponding results.

Info_type | Returns
"address" | Reference of the first cell in reference, as text.
"col" | Column number of the cell in reference.
"contents" | Value of the upper-left cell in reference; not a formula.
"row" | Row number of the cell in reference.
"type" | Text value corresponding to the type of data in the cell. Returns "b" for blank if the cell is empty, "l" for label if the cell contains a text constant, and "v" for value if the cell contains anything else.

Reference is the cell that you want information about. If omitted, information specified in info_type is returned for the last cell that was changed.

Remark

The CELL function is provided for compatibility with other spreadsheet programs.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
5-Mar
TOTAL
Formula | Description (Result)
=CELL("row",A20) | The row number of cell A20 (20)
=CELL("type",A2) | The type of data in cell A2 (v)
=CELL("contents",A3) | The content of cell A3 (TOTAL)


COUNTBLANK

Counts empty cells in a specified range of cells.

Syntax

COUNTBLANK(range)

Range is the range from which you want to count the blank cells.

Remark

Cells with formulas that return "" (empty text) are also counted. Cells with zero values are not counted.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
6 | =IF(B4<30,"",B4)
 | 27
4 | 34
Formula | Description (Result)
=COUNTBLANK(A2:B5) | Counts empty cells in the range above. The formula returns the number of empty text cells. (3)


ERROR.TYPE

Returns a number corresponding to one of the error values in the spreadsheet or returns the #N/A error if no error exists. You can use ERROR.TYPE in an IF function to test for an error value and return a text string, such as a message, instead of the error value.

Syntax

ERROR.TYPE(error_val)

Error_val is the error value whose identifying number you want to find. Although error_val can be the actual error value, it will usually be a reference to a cell containing a formula that you want to test.

If error_val is | ERROR.TYPE returns
#NULL! | 1
#DIV/0! | 2
#VALUE! | 3
#REF! | 4
#NAME? | 5
#NUM! | 6
#N/A | 7
#CIRC! | 8
Anything else | #N/A

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
#NULL!
=1/0
Formula | Description (Result)
=ERROR.TYPE(A2) | Number of the #NULL! error. (1)
=IF(ERROR.TYPE(A3)<3,CHOOSE(ERROR.TYPE(A3),"Ranges do not intersect","The divisor is zero")) | Checks cell A3 to see whether the cell contains either the #NULL! error value or the #DIV/0! error value. If it does, then the number for the error value is used in the CHOOSE worksheet function to display one of two messages; otherwise, the #N/A error value is returned. (The divisor is zero.)


IS Functions

This section describes the nine spreadsheet functions used for testing the type of a value or reference.

Each of these functions, referred to collectively as the IS functions, checks the type of value and returns TRUE or FALSE depending on the outcome. For example, the ISBLANK function returns the logical value TRUE if value is a reference to an empty cell; otherwise it returns FALSE.

Syntax

ISBLANK(value)
ISERR(value)
ISERROR(value)
ISLOGICAL(value)
ISNA(value)
ISNONTEXT(value)
ISNUMBER(value)
ISREF(value)
ISTEXT(value)

Value is the value you want tested. Value can be a blank (empty cell), error, logical, text, number, or reference value, or a name referring to any of these, that you want to test.

Function | Returns TRUE if
ISBLANK | Value refers to an empty cell.
ISERR | Value refers to any error value except #N/A.
ISERROR | Value refers to any error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!).
ISLOGICAL | Value refers to a logical value.
ISNA | Value refers to the #N/A (value not available) error value.
ISNONTEXT | Value refers to any item that is not text. (Note that this function returns TRUE if value refers to a blank cell.)
ISNUMBER | Value refers to a number.
ISREF | Value refers to a reference.
ISTEXT | Value refers to text.

Remarks

  • The value arguments of the IS functions are not converted. For example, in most other functions where a number is required, the text value "19" is converted to the number 19. However, in the formula ISNUMBER("19"), "19" is not converted from a text value, and the ISNUMBER function returns FALSE.
  • The IS functions are useful in formulas for testing the outcome of a calculation. When combined with the IF function, they provide a method for locating errors in formulas (see the following examples).

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ISLOGICAL(TRUE) | Checks whether TRUE is a logical value (TRUE)
=ISLOGICAL("TRUE") | Checks whether "TRUE" is a logical value (FALSE)
=ISNUMBER(4) | Checks whether 4 is a number (TRUE)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Gold
Region1
#REF!
330.92
#N/A
Formula | Description (Result)
=ISBLANK(A2) | Checks whether cell A2 is blank (FALSE)
=ISERROR(A4) | Checks whether #REF! is an error (TRUE)
=ISNA(A4) | Checks whether #REF! is the #N/A error (FALSE)
=ISNA(A6) | Checks whether #N/A is the #N/A error (TRUE)
=ISERR(A6) | Checks whether #N/A is an error (FALSE)
=ISNUMBER(A5) | Checks whether 330.92 is a number (TRUE)
=ISTEXT(A3) | Checks whether Region1 is text (TRUE)


N

Returns a value converted to a number.

Syntax

N(value)

Value is the value you want converted. N converts values listed in the following table.

If value is or refers to | N returns
A number | That number
A date, in one of the built-in date formats available in the spreadsheet | The serial number of that date
TRUE | 1
FALSE | 0
An error value, such as #DIV/0! | The error value
Anything else | 0

Remarks
  • It is not generally necessary to use the N function in a formula, because values are automatically converted as necessary. This function is provided for compatibility with other spreadsheet programs.
  • Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
7
Even
TRUE
4/17/2008
Formula | Description (Result)
=N(A2) | Because A2 contains a number, it is returned (7)
=N(A3) | Because A3 contains text, 0 is returned (0, see above)
=N(A4) | Because A4 is the logical value TRUE, 1 is returned (1, see above)
=N(A5) | Because A5 is a date, the serial number is returned (varies with the date system used)
=N("7") | Because "7" is text, 0 is returned (0, see above)


NA

Returns the error value #N/A. #N/A is the error value that means "no value is available." Use NA to mark empty cells. By entering #N/A in cells where you are missing information, you can avoid the problem of unintentionally including empty cells in your calculations. (When a formula refers to a cell containing #N/A, the formula returns the #N/A error value.)

Syntax

NA( )

Remarks

  • You must include the empty parentheses with the function name. Otherwise, the spreadsheet will not recognize it as a function.
  • You can also type the value #N/A directly into a cell. The NA function is provided for compatibility with other spreadsheet programs.


TYPE

Returns the type of value. Use TYPE when the behavior of another function depends on the type of value in a particular cell.

Syntax

TYPE(value)

Value can be any value, such as a number, text, logical value, and so on.

If value is | TYPE returns
Number | 1
Text | 2
Logical value | 4
Error value | 16
Array | 64

Remarks
  • You cannot use TYPE to determine whether a cell contains a formula. TYPE only determines the type of the resulting, or displayed, value. If value is a cell reference to a cell that contains a formula, TYPE returns the type of the formula's resulting value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Smith
Formula | Description (Result)
=TYPE(A2) | Checks the type of the value above (2)
=TYPE("Mr."&A2) | Checks the type of "Mr. Smith" (2)
=TYPE(2+A2) | Checks the type of the formula, which returns the error #VALUE! (16)
=TYPE({1,2;3,4}) | Checks the type of an array constant (64)


AND

Returns TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.

Syntax

AND(logical1,logical2,...)

Logical1, logical2, ... are 1 to 30 conditions you want to test that can be either TRUE or FALSE.

Remarks

  • The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values.
  • If an array or reference argument contains text or empty cells, those values are ignored.
  • If the specified range contains no logical values, AND returns the #VALUE! error value.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=AND(TRUE, TRUE) | All arguments are TRUE (TRUE)
=AND(TRUE, FALSE) | One argument is FALSE (FALSE)
=AND(2+2=4, 2+3=5) | All arguments evaluate to TRUE (TRUE)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
50
104
Formula | Description (Result)
=AND(1<A2, A2<100) | Because 50 is between 1 and 100 (TRUE)
=IF(AND(1<A3, A3<100), A3, "The value is out of range.") | Displays the second number above, if it is between 1 and 100, otherwise displays a message (The value is out of range.)
=IF(AND(1<A2, A2<100), A2, "The value is out of range.") | Displays the first number above, if it is between 1 and 100, otherwise displays a message (50)


FALSE

Returns the logical value FALSE.

Syntax

FALSE( )

Remark

You can also type the word FALSE directly onto the sheet or into the formula, and it is interpreted as the logical value FALSE.


IF

Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.

Use IF to conduct conditional tests on values and formulas.

Syntax

IF(logical_test,value_if_true,value_if_false)

Logical_test is 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 is the value that is returned if logical_test is TRUE. For example, if this argument is the text string "Within budget" and the logical_test argument evaluates to TRUE, then the IF function displays the text "Within budget". If logical_test is TRUE and value_if_true is blank, this argument returns 0 (zero). To display the word TRUE, use the logical value TRUE for this argument. Value_if_true can be another formula.

Value_if_false is the value that is returned if logical_test is FALSE. For example, if this argument is the text string "Over budget" and the logical_test argument evaluates to FALSE, then the IF function displays the text "Over budget". If logical_test is FALSE and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value FALSE is returned. If logical_test is FALSE and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned. Value_if_false can be another formula.

Remarks

  • Up to seven IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. See the last of the following examples.
  • When the value_if_true and value_if_false arguments are evaluated, IF returns the value returned by those statements.
  • If any of the arguments to IF are arrays, every element of the array is evaluated when the IF statement is carried out.
  • Additional functions can be used to analyze 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 spreadsheet function. To calculate a sum based on a string of text or a number within a range, use the SUMIF spreadsheet function.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
50
Formula | Description (Result)
=IF(A2<=100,"Within budget","Over budget") | If the number above is less than or equal to 100, then the formula displays "Within budget". Otherwise, the function displays "Over budget". (Within budget)
=IF(A2=100,SUM(B5:B15),"") | If the number above is 100, then the range B5:B15 is calculated. Otherwise, empty text ("") is returned. ()

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Actual Expenses | Predicted Expenses
1500 | 900
500 | 900
500 | 925
Formula | Description (Result)
=IF(A2>B2,"Over Budget","OK") | Checks whether the first row is over budget (Over Budget)
=IF(A3>B3,"Over Budget","OK") | Checks whether the second row is over budget (OK)

Example 3

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Score
45
90
78
Formula | Description (Result)
=IF(A2>89,"A",IF(A2>79,"B", IF(A2>69,"C",IF(A2>59,"D","F")))) | Assigns a letter grade to the first score (F)
=IF(A3>89,"A",IF(A3>79,"B", IF(A3>69,"C",IF(A3>59,"D","F")))) | Assigns a letter grade to the second score (A)
=IF(A4>89,"A",IF(A4>79,"B", IF(A4>69,"C",IF(A4>59,"D","F")))) | Assigns a letter grade to the third score (C)

In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is evaluated, and so on.

The letter grades are assigned to numbers using the following key (assuming use of integers only).

If Score is | Then return
Greater than 89 | A
From 80 to 89 | B
From 70 to 79 | C
From 60 to 69 | D
Less than 60 | F


NOT

Reverses the value of its argument. Use NOT when you want to make sure a value is not equal to one particular value.

Syntax

NOT(logical)

Logical is a value or expression that can be evaluated to TRUE or FALSE.

Remark

If logical is FALSE, NOT returns TRUE; if logical is TRUE, NOT returns FALSE.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=NOT(FALSE) | Reverses FALSE (TRUE)
=NOT(1+1=2) | Reverses an equation that evaluates to TRUE (FALSE)


OR

Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.

Syntax

OR(logical1,logical2,...)

Logical1, logical2, ... are 1 to 30 conditions you want to test that can be either TRUE or FALSE.

Remarks

  • The arguments must evaluate to logical values such as TRUE or FALSE, or be arrays or references that contain logical values.
  • If an array or reference argument contains text or empty cells, those values are ignored.
  • If the specified range contains no logical values, OR returns the #VALUE! error value.
  • You can use an OR array formula to see if a value occurs in an array. To enter an array formula, press CTRL+SHIFT+ENTER.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=OR(TRUE) | One argument is TRUE (TRUE)
=OR(1+1=1,2+2=5) | All arguments evaluate to FALSE (FALSE)
=OR(TRUE,FALSE,TRUE) | At least one argument is TRUE (TRUE)


TRUE

Returns the logical value TRUE.

Syntax

TRUE( )

Remark

You can enter the value TRUE directly into cells and formulas without using this function. The TRUE function is provided primarily for compatibility with other spreadsheet programs.


ADDRESS

Creates a cell address as text, given specified row and column numbers.

Syntax

ADDRESS(row_num,column_num,abs_num,a1,sheet_text)

Row_num is the row number to use in the cell reference.

Column_num is the column number to use in the cell reference.

Abs_num specifies the type of reference to return.

Abs_num | Returns this type of reference
1 or omitted | Absolute
2 | Absolute row; relative column
3 | Relative row; absolute column
4 | Relative

A1 is a logical value that specifies the A1 or R1C1 reference style. If a1 is TRUE or omitted, ADDRESS returns an A1-style reference; if FALSE, ADDRESS returns an R1C1-style reference.

Sheet_text is text specifying the name of the sheet to be used as the external reference. If sheet_text is omitted, no sheet name is used.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ADDRESS(2,3) | Absolute reference ($C$2)
=ADDRESS(2,3,2) | Absolute row; relative column (C$2)
=ADDRESS(2,3,2,FALSE) | Absolute row; relative column in R1C1 reference style (R2C[3])
=ADDRESS(2,3,1,FALSE,"Sheet1") | Absolute reference to another sheet (Sheet1!R2C3)


AREAS

Returns the number of areas in a reference. An area is a range of contiguous cells or a single cell.

Syntax

AREAS(reference)

Reference is a reference to a cell or range of cells and can refer to multiple areas. If you want to specify several references as a single argument, then you must include extra sets of parentheses so that the comma will not be interpreted as a field separator. See the following example.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=AREAS(B2:D4) | Number of areas in the range (1)
=AREAS((B2:D4,E5,F6:I9)) | Number of areas in the range (3)
=AREAS((B2:D4,B2)) | Number of areas in the range (2)


CHOOSE

Uses index_num to return a value from the list of value arguments. Use CHOOSE to select one of up to 29 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,...)

Index_num specifies which value argument is selected. Index_num must be a number between 1 and 29, or a formula or reference to a cell containing a number between 1 and 29.

  • 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,... are 1 to 29 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.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
1st | Nails
2nd | Screws
3rd | Nuts
Finished | Bolts
Formula | Description (Result)
=CHOOSE(2,A2,A3,A4,A5) | Value from the second argument A3 (2nd)
=CHOOSE(4,B2,B3,B4,B5) | Value from the fourth argument B5 (Bolts)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
23
45
12
10
Formula | Description (Result)
=SUM(A2:CHOOSE(2,A3,A4,A5)) | Sums the range A2:A4 (80)


COLUMN

Returns the column number of the given reference.

Syntax

COLUMN(reference)

Reference is the cell or range of cells for which you want the column number.

Remarks

  • If reference is omitted, it is assumed to be the reference of the cell in which the COLUMN function appears.
  • If reference is a range of cells, and if COLUMN is entered as a horizontal array, COLUMN returns the column numbers of reference as a horizontal array.
  • Reference cannot refer to multiple areas.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=COLUMN() | Column in which the formula appears (1)
=COLUMN(B10) | Column of the reference (2)


COLUMNS

Returns the number of columns in an array or reference.

Syntax

COLUMNS(array)

Array is an array or array formula, or a reference to a range of cells for which you want the number of columns.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=COLUMNS(C1:E4) | Number of columns in the reference (3)
=COLUMNS({1,2,3;4,5,6}) | Number of columns in the array constant (3)


HLOOKUP

Searches for a value in the top row of a table or in an array of values, and then returns a value in the same column from a row you specify in the table or array. Use HLOOKUP when your comparison values are located in a row across the top of a table of data, and you want to look down a specified number of rows. Use VLOOKUP when your comparison values are located in a column to the left of the data you want to find.

The H in HLOOKUP stands for Horizontal.

Syntax

HLOOKUP(lookup_value,table_array,row_index_num,range_lookup)

Lookup_value is the value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.

Table_array is a table of information in which data is looked up. Use a reference to a range or a range name.

  • The values in the first row of table_array can be text, numbers, or logical values.

  • If range_lookup is TRUE, the values in the first row of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, HLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted.

  • Uppercase and lowercase text are equivalent.

  • You can put values in ascending order by clicking Button image on the spreadsheet toolbar.

Row_index_num is the row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.

Range_lookup is a logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.

Remarks

  • If HLOOKUP can't find lookup_value, and range_lookup is TRUE, it uses the largest value that is less than lookup_value.
  • If lookup_value is smaller than the smallest value in the first row of table_array, HLOOKUP returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Axles | Bearings | Bolts
4 | 4 | 9
5 | 7 | 10
6 | 8 | 11
Formula | Description (Result)
=HLOOKUP("Axles",A1:C4,2,TRUE) | Looks up Axles in row 1, and returns the value from row 2 that's in the same column. (4)
=HLOOKUP("Bearings",A1:C4,3,FALSE) | Looks up Bearings in row 1, and returns the value from row 3 that's in the same column. (7)
=HLOOKUP("B",A1:C4,3,TRUE) | Looks up B in row 1, and returns the value from row 3 that's in the same column. Because B is not an exact match, the next largest value that is less than B is used: Axles. (5)
=HLOOKUP("Bolts",A1:C4,4) | Looks up Bolts in row 1, and returns the value from row 4 that's in the same column. (11)
=HLOOKUP(3,{1,2,3;"a","b","c";"d","e","f"},2,TRUE) | Looks up 3 in the first row of the array constant, and returns the value from row 2 in same column. (c)


HYPERLINK

Creates a hyperlink that opens a document stored on a network server, an intranet, or the Internet. When you click the cell that contains the HYPERLINK function, the file stored at link_location is opened.

Syntax

HYPERLINK(link_location,friendly_name)

Link_location is the path and file name of the document to be opened as text. The path can be to a file stored on a hard disk drive, or the path can be a universal naming convention (UNC) path on a server or it can be a Uniform Resource Locator (URL) path on the Internet or an intranet.

  • Link_location can be a text string enclosed in quotation marks or a cell that contains the link as a text string.

  • If the jump specified in link_location does not exist or cannot be navigated, an error appears when you click the cell.

Friendly_name is the jump text or numeric value that is displayed in the cell. Friendly_name is displayed in blue and is underlined. If friendly_name is omitted, the cell displays the link_location as the jump text.

  • Friendly_name can be a value, a text string, a name, or a cell that contains the jump text or value.

  • If friendly_name returns an error value (for example, #VALUE!), the cell displays the error instead of the jump text.

Remark

To select a cell that has a hyperlink in it without jumping to the hyperlink destination, click a cell next to the cell with the hyperlink, and then use the arrow keys to select it.

Example

The following example opens a spreadsheet named Budget Report.xls that is stored on the Internet at the location named example.microsoft.com/report and displays the text "Click for report":

=HYPERLINK("http://example.microsoft.com/report/budget report.xls", "Click for report")


INDEX

Returns a value or the reference to a value from within a table or range. There are two forms of the INDEX() function: array and reference. The array form always returns a value or an array of values; the reference form always returns a reference.

INDEX(array,row_num,column_num) returns the value of a specified cell or array of cells within array.

INDEX(reference,row_num,column_num,area_num) returns a reference to specified cells within reference.

Show Syntax 1 (array)

Returns the value of an element in a table or an array, selected by the row and column number indexes.

The INDEX function has two syntax forms: array and reference. The array form always returns a value or array of values; the reference form always returns a reference. Use the array form if the first argument to INDEX is an array constant.

Syntax 1

Array form

INDEX(array,row_num,column_num)

Array is a range of cells or an array constant.

  • If array contains only one row or column, the corresponding row_num or column_num argument is optional.

  • If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array.

Row_num selects the row in array from which to return a value. If row_num is omitted, column_num is required.

Column_num selects the column in array from which to return a value. If column_num is omitted, row_num is required.

Remarks

  • If both the row_num and column_num arguments are used, INDEX returns the value in the cell at the intersection of row_num and column_num.
  • If you set row_num or column_num to 0 (zero), INDEX returns the array of values for the entire column or row, respectively. To use values returned as an array, enter the INDEX function as an array formula in a horizontal range of cells for a row, and in a vertical range of cells for a column. To enter an array formula, press CTRL+SHIFT+ENTER.

  • Row_num and column_num must point to a cell within array; otherwise, INDEX returns the #REF! error value.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
Apples | Lemons
Bananas | Pears
Formula | Description (Result)
=INDEX(A2:B3,2,2) | Value at the intersection of the second row and second column in the range (Pears)
=INDEX(A2:B3,2,1) | Value at the intersection of the second row and first column in the range (Bananas)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=INDEX({1,2;3,4},0,2) | Value in the first row, second column in the array constant (2)
 | Value in the second row, second column in the array constant (4)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A2:A3, 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.

Show Syntax 2 (reference)

Returns the reference of the cell at the intersection of a particular row and column. If the reference is made up of nonadjacent selections, you can pick the selection to look in.

The INDEX function has two syntax forms: array and reference. The array form always returns a value or an array of values; the reference form always returns a reference.

Syntax 2

Reference form

INDEX(reference,row_num,column_num,area_num)

Reference is a reference to one or more cell ranges.

  • If you are entering a nonadjacent range for the reference, enclose reference in parentheses.

  • If each area in reference contains only one row or column, the row_num or column_num argument, respectively, is optional. For example, for a single row reference, use INDEX(reference,,column_num).

Row_num is the number of the row in reference from which to return a reference.

Column_num is the number of the column in reference from which to return a reference.

Area_num selects a range in reference from which to return the intersection of row_num and column_num. The first area selected or entered is numbered 1, the second is 2, and so on. If area_num is omitted, INDEX uses area 1.

  • For example, if reference describes the cells (A1:B4,D1:E4,G1:H4), then area_num 1 is the range A1:B4, area_num 2 is the range D1:E4, and area_num 3 is the range G1:H4.

Remarks

  • After reference and area_num have selected a particular range, row_num and column_num select a particular cell: row_num 1 is the first row in the range, column_num 1 is the first column, and so on. The reference returned by INDEX is the intersection of row_num and column_num.

  • If you set row_num or column_num to 0 (zero), INDEX returns the reference for the entire column or row, respectively.

  • Row_num, column_num, and area_num must point to a cell within reference; otherwise, INDEX returns the #REF! error value. If row_num and column_num are omitted, INDEX returns the area in reference specified by area_num.
  • The result of the INDEX function is a reference and is interpreted as such by other formulas. Depending on the formula, the return value of INDEX may be used as a reference or as a value. For example, the formula CELL("width",INDEX(A1:B2,1,2)) is equivalent to CELL("width",B1). The CELL function uses the return value of INDEX as a cell reference. On the other hand, a formula such as 2*INDEX(A1:B2,1,2) translates the return value of INDEX into the number in cell B1.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Fruit | Price | Count
Apples | 0.69 | 40
Bananas | 0.34 | 38
Lemons | 0.55 | 15
Oranges | 0.25 | 25
Pears | 0.59 | 40
Almonds | 2.80 | 10
Cashews | 3.55 | 16
Peanuts | 1.25 | 20
Walnuts | 1.75 | 12
Formula | Description (Result)
=INDEX(A2:C6,2,3) | The intersection of the second row and third column in the range A2:C6, which is the content of cell C3. (38)
=INDEX((A1:C6,A8:C11),2,2,2) | The intersection of the second row and second column in the second area of A8:C11, which is the content of cell B9. (3.55)
=SUM(INDEX(A1:C11,0,3,1)) | The sum of the third column in the first area of the range A1:C11, which is the sum of C1:C6. (216)


INDIRECT

Returns the reference specified by a text string. References are immediately evaluated to display their contents. Use INDIRECT when you want to change the reference to a cell within a formula without changing the formula itself.

Syntax

INDIRECT(ref_text,a1)

Ref_text is a reference to a cell that contains an A1-style reference, an R1C1-style reference, a name defined as a reference, or a reference to a cell as a text string. If ref_text is not a valid cell reference, INDIRECT returns the #REF! error value.

  • If ref_text refers to another workbook (an external reference), the other workbook must be open. If the source workbook is not open, INDIRECT returns the #REF! error value.

A1 is a logical value that specifies what type of reference is contained in the cell ref_text.

  • If a1 is TRUE or omitted, ref_text is interpreted as an A1-style reference.

  • If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
B2 | 1.333
B3 | 45
George | 10
5 | 62
Formula | Description (Result)
=INDIRECT($A$2) | Value of the reference in cell A2 (1.333)
=INDIRECT($A$3) | Value of the reference in cell A3 (45)
=INDIRECT($A$4) | If the cell B4 has the defined name "George", the value of the defined name is returned (10)
=INDIRECT("B"&$A$5) | Value of a reference in cell A5 (62)

When you create a formula that refers to a cell, the reference to the cell will be updated if: (1) the cell is moved by pressing Cut to delete the cell or (2) the cell is moved because rows or columns are inserted or deleted. If you always want the formula to refer to the same cell regardless of whether the row above the cell is deleted or the cell is moved, use the INDIRECT spreadsheet function. For example, if you always want to refer to cell A10, use the following syntax:

=INDIRECT("A10")


LOOKUP

Returns a value either from a one-row or one-column range or from an array. The LOOKUP function has two syntax forms: vector and array. The vector form of LOOKUP looks in a one-row or one-column range (known as a vector) for a value and returns a value from the same position in a second one-row or one-column range. The array form of LOOKUP looks in the first row or column of an array for the specified value and returns a value from the same position in the last row or column of the array.

Show Syntax 1 (vector)

LOOKUP(lookup_value,lookup_vector,result_vector)

Lookup_value is a value that LOOKUP searches for in the first vector. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.

Lookup_vector is a range that contains only one row or one column. The values in lookup_vector can be text, numbers, or logical values.

Important The values in lookup_vector must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give the correct value. Uppercase and lowercase text are equivalent.

Result_vector is a range that contains only one row or column. It must be the same size as lookup_vector.

Remarks

  • If LOOKUP can't find the lookup_value, it matches the largest value in lookup_vector that is less than or equal to lookup_value.
  • If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP gives the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Frequency | Color
4.14 | red
4.19 | orange
5.17 | yellow
5.77 | green
6.39 | blue
Formula | Description (Result)
=LOOKUP(4.91,A2:A6,B2:B6) | Looks up 4.19 in column A, and returns the value from column B that's in the same row (orange)
=LOOKUP(5.00,A2:A6,B2:B6) | Looks up 5.00 in column A, and returns the value from column B that's in the same row (orange)
=LOOKUP(7.66,A2:A6,B2:B6) | Looks up 7.66 in column A, matches the next smallest value (6.39), and returns the value from column B that's in the same row (blue)
=LOOKUP(0,A2:A6,B2:B6) | Looks up 0 in column A, and returns an error because 0 is less than the smallest value in the lookup_vector A2:A7 (#N/A)

Show Syntax 2 (array)

LOOKUP(lookup_value,array)

Lookup_value is a value that LOOKUP searches for in an array. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.

  • If LOOKUP can't find the lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.

  • If lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.

Array is a range of cells that contains text, numbers, or logical values that you want to compare with lookup_value.

The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.

  • If array covers an area that is wider than it is tall (more columns than rows), LOOKUP searches for lookup_value in the first row.

  • If array is square or is taller than it is wide (more rows than columns), LOOKUP searches in the first column.

  • With HLOOKUP and VLOOKUP, you can index down or across, but LOOKUP always selects the last value in the row or column.

Important The values in array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give the correct value. Uppercase and lowercase text are equivalent.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=LOOKUP("C",{"a","b","c","d";1,2,3,4}) | Looks up "C" in first row of the array and returns the value in the last row that's in the same column (3)
=LOOKUP("bump",{"a",1;"b",2;"c",3}) | Looks up "bump" in first row of the array and returns the value in the last column that's in the same row (2)


MATCH

Returns the relative position of an item in an array that matches a specified value in a specified order. Use MATCH instead of one of the LOOKUP functions when you need the position of an item in a range instead of the item itself.

Syntax

MATCH(lookup_value,lookup_array,match_type)

Lookup_value is the value you use to find the value you want in a table.

  • Lookup_value is the value you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.

  • Lookup_value can be a value (number, text, or logical value) or a cell reference to a number, text, or logical value.

Lookup_array is a contiguous range of cells containing possible lookup values. Lookup_array must be an array or an array reference.

Match_type is the number -1, 0, or 1. Match_type specifies how lookup_value matches with values in lookup_array.

  • If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

  • If match_type is 0, MATCH finds the first value that is exactly equal to lookup_value. Lookup_array can be in any order.

  • If match_type is -1, MATCH finds the smallest value that is greater than or equal to lookup_value. Lookup_array must be placed in descending order: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and so on.

  • If match_type is omitted, it is assumed to be 1.

Remarks

  • MATCH returns the position of the matched value within lookup_array, not the value itself. For example, MATCH("b",{"a","b","c"},0) returns 2, the relative position of "b" within the array {"a","b","c"}.
  • MATCH does not distinguish between uppercase and lowercase letters when matching text values.
  • If MATCH is unsuccessful in finding a match, it returns the #N/A error value.
  • If match_type is 0 and lookup_value is text, lookup_value can contain the wildcard characters asterisk (*) and question mark (?). An asterisk matches any sequence of characters; a question mark matches any single character.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Product | Count
Bananas | 25
Oranges | 38
Apples | 40
Pears | 41
Formula | Description (Result)
=MATCH(39,B2:B5,1) | Because there is not an exact match, the position of the next lowest value (38) in the range B2:B5 is returned. (2)
=MATCH(41,B2:B5,0) | The position of 41 in the range B2:B5. (4)
=MATCH(40,B2:B5,-1) | Returns an error because the range B2:B5 is not in descending order. (#N/A)


OFFSET

Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and the number of columns to be returned.

Syntax

OFFSET(reference,rows,cols,height,width)

Reference is the reference from which you want to base the offset. Reference must refer to a cell or range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.

Rows is the number of rows, up or down, that you want the upper-left cell to refer to. Using 5 as the rows argument specifies that the upper-left cell in the reference is five rows below reference. Rows can be positive (which means below the starting reference) or negative (which means above the starting reference).

Cols is the number of columns, to the left or right, that you want the upper-left cell of the result to refer to. Using 5 as the cols argument specifies that the upper-left cell in the reference is five columns to the right of reference. Cols can be positive (which means to the right of the starting reference) or negative (which means to the left of the starting reference).

Height is the height, in number of rows, that you want the returned reference to be. Height must be a positive number.

Width is the width, in number of columns, that you want the returned reference to be. Width must be a positive number.

Remarks

  • If rows and cols offset reference over the edge of the spreadsheet, OFFSET returns the #REF! error value.

  • If height or width is omitted, it is assumed to be the same height or width as reference.

  • OFFSET doesn't actually move any cells or change the selection; it just returns a reference. OFFSET can be used with any function expecting a reference argument. For example, the formula SUM(OFFSET(C2,1,2,3,1)) calculates the total value of a 3-row by 1-column range that is 1 row below and 2 columns to the right of cell C2.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=OFFSET(C3,2,3,1,1) | Displays the value in cell F5 (0)
=SUM(OFFSET(C3:E5,-1,0,3,3)) | Sums the range C2:E4 (0)
=OFFSET(C3:E5,0,-3,3,3) | Returns an error, because the reference is not on the spreadsheet (#REF!)


ROW

Returns the row number of a reference.

Syntax

ROW(reference)

Reference is the cell or range of cells for which you want the row number.

  • If reference is omitted, it is assumed to be the reference of the cell in which the ROW function appears.

  • If reference is a range of cells, and if ROW is entered as a vertical array, ROW returns the row numbers of reference as a vertical array.

  • Reference cannot refer to multiple areas.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROW() | Row in which the formula appears (2)
=ROW(C10) | Row of the reference (10)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROW(C4:D6) | First row in the reference (4)
 | Second row in the reference (5)
 | Third row in the reference (6)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A2:A4 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 4.


ROWS

Returns the number of rows in a reference or array.

Syntax

ROWS(array)

Array is an array, an array formula, or a reference to a range of cells for which you want the number of rows.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROWS(C1:E4) | Number of rows in the reference (4)
=ROWS({1,2,3;4,5,6}) | Number of rows in the array constant (2)


TRANSPOSE

Returns a vertical range of cells as a horizontal range, or vice versa. TRANSPOSE must be entered as an array formula in a range that has the same number of rows and columns, respectively, as an array has columns and rows. Use TRANSPOSE to shift the vertical and horizontal orientation of an array on a spreadsheet.

Syntax

TRANSPOSE(array)

Array is an array or range of cells on a spreadsheet that you want to transpose. The transpose of an array is created by using the first row of the array as the first column of the new array, the second row of the array as the second column of the new array, and so on.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data | Data
1 | 2 | 3
Formula | Description (Result)
=TRANSPOSE($A$2:$C$2) | Value from first column (1)
 | Value from second column (2)
 | Value from third column (3)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A4:A6 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 1.

Example 2

Some functions, such as LINEST, return horizontal arrays. LINEST returns a horizontal array of the slope and Y-intercept for a line. The following formula returns a vertical array of the slope and Y-intercept from LINEST.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known y | Known x
1 | 0
9 | 4
5 | 2
7 | 3
Formula | Description (Result)
=TRANSPOSE(LINEST(A2:A5,B2:B5,,FALSE)) | Slope (2)
 | Y-intercept (1)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A7:A8 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.


VLOOKUP

Searches for a value in the leftmost column of a table, and then returns a value in the same row from a column you specify in the table. Use VLOOKUP instead of HLOOKUP when your comparison values are located in a column to the left of the data you want to find.

The V in VLOOKUP stands for Vertical.

Syntax

VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

Lookup_value is the value to be found in the first column of the array. Lookup_value can be a value, a reference, or a text string.

Table_array is the table of information in which data is looked up. Use a reference to a range or a range name, such as Database or List.

  • If range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted.

  • You can put the values in ascending order by clicking Sort Ascending Button image on the spreadsheet toolbar.

  • The values in the first column of table_array can be text, numbers, or logical values.

  • Uppercase and lowercase text are equivalent.

Col_index_num is the column number in table_array from which the matching value must be returned. A col_index_num 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 col_index_num is less than 1, VLOOKUP returns the #VALUE! error value; if col_index_num is greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.

Range_lookup is a logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, VLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.

Remarks

  • If VLOOKUP can't find lookup_value, and range_lookup is TRUE, it uses the largest value that is less than or equal to lookup_value.
  • If lookup_value is smaller than the smallest value in the first column of table_array, VLOOKUP returns the #N/A error value.
  • If VLOOKUP can't find lookup_value, and range_lookup is FALSE, VLOOKUP returns the #N/A value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.

The example uses values for air at 1 atm pressure.

Density | Viscosity | Temperature
0.457 | 3.55 | 500
0.525 | 3.25 | 400
0.616 | 2.93 | 300
0.675 | 2.75 | 250
0.746 | 2.57 | 200
0.835 | 2.38 | 150
0.946 | 2.17 | 100
1.09 | 1.95 | 50
1.29 | 1.71 | 0
Formula | Description (Result)
=VLOOKUP(1,A2:C10,2) | Looks up 1 in column A, and returns the value from column B in the same row. (2.17)
=VLOOKUP(1,A2:C10,3,TRUE) | Looks up 1 in column A, and returns the value from column C in the same row. (100)
=VLOOKUP(.7,A2:C10,3,FALSE) | Looks up 0.746 in column A. Because there is no exact match in column A, an error is returned. (#N/A)
=VLOOKUP(0.1,A2:C10,2,TRUE) | Looks up 0.1 in column A. Because 0.1 is less than the smallest value in column A, an error is returned. (#N/A)
=VLOOKUP(2,A2:C10,2,TRUE) | Looks up 2 in column A, and returns the value from column B in the same row. (1.71)


ABS

Returns the absolute value of a number. The absolute value of a number is the number without its sign.

Syntax

ABS(number)

Number is the real number of which you want the absolute value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
-4
Formula | Description (Result)
=ABS(2) | Absolute value of 2 (2)
=ABS(-2) | Absolute value of -2 (2)
=ABS(A2) | Absolute value of -4 (4)


ACOS

Returns the arccosine, or inverse cosine, of a number. The arccosine is the angle whose cosine is number. The returned angle is given in radians in the range 0 (zero) to pi.

Syntax

ACOS(number)

Number is the cosine of the angle you want and must be from -1 to 1.

Remark

If you want to convert the result from radians to degrees, multiply it by 180/PI() or use the DEGREES function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ACOS(-0.5) | Arccosine of -0.5 in radians, 2*pi/3 (2.094395)
=ACOS(-0.5)*180/PI() | Arccosine of -0.5 in degrees (120)
=DEGREES(ACOS(-0.5)) | Arccosine of -0.5 in degrees (120)


ACOSH

Returns the inverse hyperbolic cosine of a number. Number must be greater than or equal to 1. The inverse hyperbolic cosine is the value whose hyperbolic cosine is number, so ACOSH(COSH(number)) equals number.

Syntax

ACOSH(number)

Number is any real number equal to or greater than 1.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ACOSH(1) | Inverse hyperbolic cosine of 1 (0)
=ACOSH(10) | Inverse hyperbolic cosine of 10 (2.993223)


ASIN

Returns the arcsine, or inverse sine, of a number. The arcsine is the angle whose sine is number. The returned angle is given in radians in the range -pi/2 to pi/2.

Syntax

ASIN(number)

Number is the sine of the angle you want and must be from -1 to 1.

Remark

To express the arcsine in degrees, multiply the result by 180/PI() or use the DEGREES function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ASIN(-0.5) | Arcsine of -0.5 in radians, -pi/6 (-0.5236)
=ASIN(-0.5)*180/PI() | Arcsine of -0.5 in degrees (-30)
=DEGREES(ASIN(-0.5)) | Arcsine of -0.5 in degrees (-30)


ASINH

Returns the inverse hyperbolic sine of a number. The inverse hyperbolic sine is the value whose hyperbolic sine is number, so ASINH(SINH(number)) equals number.

Syntax

ASINH(number)

Number is any real number.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ASINH(-2.5) | Inverse hyperbolic sine of -2.5 (-1.64723)
=ASINH(10) | Inverse hyperbolic sine of 10 (2.998223)


ATAN

Returns the arctangent, or inverse tangent, of a number. The arctangent is the angle whose tangent is number. The returned angle is given in radians in the range -pi/2 to pi/2.

Syntax

ATAN (number)

Number is the tangent of the angle you want.

Remark

To express the arctangent in degrees, multiply the result by 180/PI() or use the DEGREES function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ATAN(1) | Arctangent of 1 in radians, pi/4 (0.785398)
=ATAN(1)*180/PI() | Arctangent of 1 in degrees (45)
=DEGREES(ATAN(1)) | Arctangent of 1 in degrees (45)


ATAN2

Returns the arctangent, or inverse tangent, of the specified x- and y-coordinates. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (x_num, y_num). The angle is given in radians between -pi and pi, excluding -pi.

Syntax

ATAN2(x_num,y_num)

X_num is the x-coordinate of the point.

Y_num is the y-coordinate of the point.

Remarks

  • A positive result represents a counterclockwise angle from the x-axis; a negative result represents a clockwise angle.
  • ATAN2(a,b) equals ATAN(b/a), except that a can equal 0 in ATAN2.
  • If both x_num and y_num are 0, ATAN2 returns the #DIV/0! error value.
  • To express the arctangent in degrees, multiply the result by 180/PI( ) or use the DEGREES function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ATAN2(1, 1) | Arctangent of the point 1,1 in radians, pi/4 (0.785398)
=ATAN2(-1, -1) | Arctangent of the point -1,-1 in radians, -3*pi/4 (-2.35619)
=ATAN2(-1, -1)*180/PI() | Arctangent of the point 1,1 in degrees (-135)
=DEGREES(ATAN2(-1, -1)) | Arctangent of the point 1,1 in degrees (-135)


ATANH

Returns the inverse hyperbolic tangent of a number. Number must be between -1 and 1 (excluding -1 and 1). The inverse hyperbolic tangent is the value whose hyperbolic tangent is number; ATANH(TANH(number)) equals number.

Syntax

ATANH(number)

Number is any real number between 1 and -1.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ATANH(0.76159416) | Inverse hyperbolic tangent of 0.76159416 (1, approximately)
=ATANH(-0.1) | Inverse hyperbolic tangent of -0.1 (-0.10034)


CEILING

Returns number rounded up, away from zero, to the nearest multiple of significance. For example, if you want to avoid using pennies in your prices and your product is priced at $4.42, use the formula =CEILING(4.42,0.05) to round prices up to the nearest nickel.

Syntax

CEILING(number,significance)

Number is the value you want to round.

Significance is the multiple to which you want to round.

Remarks

  • If either argument is nonnumeric, CEILING returns the #VALUE! error value.
  • Regardless of the sign of number, a value is rounded up when adjusted away from zero. If number is an exact multiple of significance, no rounding occurs.
  • If number and significance have different signs, CEILING returns the #NUM! error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=CEILING(2.5, 1) | Rounds 2.5 up to nearest multiple of 1 (3)
=CEILING(-2.5, -2) | Rounds -2.5 up to nearest multiple of -2 (-4)
=CEILING(-2.5, 2) | Returns an error, because -2.5 and 2 have different signs (#NUM!)
=CEILING(1.5, 0.1) | Rounds 1.5 up to the nearest multiple of 0.1 (1.5)
=CEILING(0.234, 0.01) | Rounds 0.234 up to the nearest multiple of 0.01 (0.24)


COMBIN

Returns the number of combinations for a given number of items. Use COMBIN to determine the total possible number of groups for a given number of items.

Syntax

COMBIN(number,number_chosen)

Number is the number of items.

Number_chosen is the number of items in each combination.

Remarks

  • Numeric arguments are truncated to integers.
  • If either argument is nonnumeric, COMBIN returns the #VALUE! error value.
  • If number < 0, number_chosen < 0, or number < number_chosen, COMBIN returns the #NUM! error value.
  • A combination is any set or subset of items, regardless of their internal order. Combinations are distinct from permutations, for which the internal order is significant.
  • The number of combinations is as follows, where number = n and number_chosen = k:

    where:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=COMBIN(8,2) | Possible two-person teams that can be formed from 8 candidates (28)


COS

Returns the cosine of the given angle.

Syntax

COS(number)

Number is the angle in radians for which you want the cosine.

Remark

If the angle is in degrees, multiply it by PI()/180 or use the COS function to convert it to radians.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=COS(1.047) | Cosine of 1.047 radians (0.500171)
=COS(60*PI()/180) | Cosine of 60 degrees (0.5)
=COS(RADIANS(60)) | Cosine of 60 degrees (0.5)


COSH

Returns the hyperbolic cosine of a number.

Syntax

COSH(number)

Number is any real number for which you want to find the hyperbolic cosine.

Remark

The formula for the hyperbolic cosine is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=COSH(4) | Hyperbolic cosine of 4 (27.30823)
=COSH(EXP(1)) | Hyperbolic cosine of the base of the natural logarithm (7.610125)


COUNTIF

Counts the number of cells within a range that meet the given criteria.

Syntax

COUNTIF(range,criteria)

Range is the range of cells from which you want to count cells.

Criteria is the criteria in the form of a number, expression, or text that defines which cells will be counted. For example, criteria can be expressed as 32, "32", ">32", "apples".

Remarks

There are additional functions that can be used to analyze your data based on a condition. For example, to calculate a sum based on a string of text or a number within a range, use the SUMIF spreadsheet function. To have a formula return one of two values based on a condition, such as a sales bonus based on a specified sales amount, use the IF spreadsheet function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
apples | 32
oranges | 54
peaches | 75
apples | 86
Formula | Description (Result)
=COUNTIF(A2:A5,"apples") | Number of cells with apples in the first column above (2)
=COUNTIF(B2:B5,">55") | Number of cells with a value greater than 55 in the second column above (2)


DEGREES

Converts radians into degrees.

Syntax

DEGREES(angle)

Angle is the angle in radians that you want to convert.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=DEGREES(PI()) | Degrees of pi radians (180)


EVEN

Returns number rounded up to the nearest even integer. You can use this function for processing items that come in twos. For example, a packing crate accepts rows of one or two items. The crate is full when the number of items, rounded up to the nearest two, matches the crate's capacity.

Syntax

EVEN(number)

Number is the value to round.

Remarks

  • If number is nonnumeric, EVEN returns the #VALUE! error value.
  • Regardless of the sign of number, a value is rounded up when adjusted away from zero. If number is an even integer, no rounding occurs.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=EVEN(1.5) | Rounds 1.5 up to the nearest even integer (2)
=EVEN(3) | Rounds 3 up to the nearest even integer (4)
=EVEN(2) | Rounds 2 up to the nearest even integer (2)
=EVEN(-1) | Rounds -1 up to the nearest even integer (-2)


EXP

Returns e raised to the power of number. The constant e equals 2.71828182845904, the base of the natural logarithm.

Syntax

EXP(number)

Number is the exponent applied to the base e.

Remarks

  • To calculate powers of other bases, use the exponentiation operator (^).
  • EXP is the inverse of LN, the natural logarithm of number.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=EXP(1) | Approximate value of e (2.718282)
=EXP(2) | Base of the natural logarithm e raised to the power of 2 (7.389056)


FACT

Returns the factorial of a number. The factorial of a number is equal to 1*2*3*...* number.

Syntax

FACT(number)

Number is the nonnegative number you want the factorial of. If number is not an integer, it is truncated.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=FACT(5) | Factorial of 5, or 1*2*3*4*5 (120)
=FACT(1.9) | Factorial of the integer of 1.9 (1)
=FACT(0) | Factorial of 0 (1)
=FACT(-1) | Negative numbers cause an error value (#NUM!)
=FACT(1) | Factorial of 1 (1)


FLOOR

Rounds number down, toward zero, to the nearest multiple of significance.

Syntax

FLOOR(number,significance)

Number is the numeric value you want to round.

Significance is the multiple to which you want to round.

Remarks

  • If either argument is nonnumeric, FLOOR returns the #VALUE! error value.
  • If number and significance have different signs, FLOOR returns the #NUM! error value.
  • Regardless of the sign of number, a value is rounded down when adjusted away from zero. If number is an exact multiple of significance, no rounding occurs.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=FLOOR(2.5, 1) | Rounds 2.5 down to nearest multiple of 1 (2)
=FLOOR(-2.5, -2) | Rounds -2.5 down to nearest multiple of -2 (-2)
=FLOOR(-2.5, 2) | Returns an error, because -2.5 and 2 have different signs (#NUM!)
=FLOOR(1.5, 0.1) | Rounds 1.5 down to the nearest multiple of 0.1 (1.5)
=FLOOR(0.234, 0.01) | Rounds 0.234 down to the nearest multiple of 0.01 (0.23)


INT

Rounds a number down to the nearest integer.

Syntax

INT(number)

Number is the real number you want to round down to an integer.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
19.5
Formula | Description (Result)
=INT(8.9) | Rounds 8.9 down (8)
=INT(-8.9) | Rounds -8.9 down (-9)
=A2-INT(A2) | Returns the decimal part of a positive real number in cell A2 (0.5)


LN

Returns the natural logarithm of a number. Natural logarithms are based on the constant e (2.71828182845904).

Syntax

LN(number)

Number is the positive real number for which you want the natural logarithm.

Remark

LN is the inverse of the EXP function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=LN(86) | Natural logarithm of 86 (4.454347)
=LN(2.7182818) | Natural logarithm of the value of the constant e (1)
=LN(EXP(3)) | Natural logarithm of e raised to the power of 3 (3)


LOG

Returns the logarithm of a number to the base you specify.

Syntax

LOG(number,base)

Number is the positive real number for which you want the logarithm.

Base is the base of the logarithm. If base is omitted, it is assumed to be 10.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=LOG(10) | Logarithm of 10 (1)
=LOG(8, 2) | Logarithm of 8 with base 2 (3)
=LOG(86, 2.7182818) | Logarithm of 86 with base e (4.454347)


LOG10

Returns the base-10 logarithm of a number.

Syntax

LOG10(number)

Number is the positive real number for which you want the base-10 logarithm.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=LOG10(86) | Base-10 logarithm of 86 (1.934498451)
=LOG10(10) | Base-10 logarithm of 10 (1)
=LOG10(1E5) | Base-10 logarithm of 1E5 (5)
=LOG10(10^5) | Base-10 logarithm of 10^5 (5)


MDETERM

Returns the matrix determinant of an array.

Syntax

MDETERM(array)

Array is a numeric array with an equal number of rows and columns.

Remarks

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

  • If any cells in array are empty or contain text, MDETERM returns the #VALUE! error value.

  • MDETERM also returns #VALUE! if array does not have an equal number of rows and columns.

  • The matrix determinant is a number derived from the values in array. For a three-row, three-column array, A1:C3, the determinant is defined as:

    MDETERM(A1:C3) equals
    A1*(B2*C3-B3*C2) + A2*(B3*C1-B1*C3) + A3*(B1*C2-B2*C1)

  • Matrix determinants are generally used for solving systems of mathematical equations that involve several variables.
  • MDETERM is calculated with an accuracy of approximately 16 digits, which may lead to a small numeric error when the calculation is not complete. For example, the determinant of a singular matrix may differ from zero by 1E-16.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data | Data | Data
1 | 3 | 8 | 5
1 | 3 | 6 | 1
1 | 1 | 1 | 0
7 | 3 | 10 | 2
Formula | Description (Result)
=MDETERM(A2:D5) | Determinant of the matrix above (88)
=MDETERM({3,6,1;1,1,0;3,10,2}) | Determinant of the matrix as an array constant (1)
=MDETERM({3,6;1,1}) | Determinant of the matrix in the array constant (-3)
=MDETERM({1,3,8,5;1,3,6,1}) | Returns an error because the array does not have an equal number of rows and columns (#VALUE!)


MINVERSE

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

Syntax

MINVERSE(array)

Array is 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, and that these letters represent any four numbers. The following table shows the inverse of the matrix A1:B2.
    Column A | Column B
    Row 1 | d/(a*d-b*c) | b/(b*c-a*d)
    Row 2 | c/(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 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
4 | -1
2 | 0
Formula | Formula
=MINVERSE(A2:B3) |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, 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.

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data | Data
1 | 2 | 1
3 | 4 | -1
0 | 2 | 0
Formula | Formula | Formula
=MINVERSE(A2:C4) |  |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, 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.

Show Tip

Use the INDEX function to access individual elements from the inverse matrix.


MMULT

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)

Array1, array2 are 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.
  • If any cells are empty or contain text, or if the number of columns in array1 is different from the number of rows in array2, MMULT returns the #VALUE! error value.
  • The matrix product array a of the two arrays b and c is:

    where i is the row number, and j is the column number.

  • Formulas that return arrays must be entered as array formulas.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Array 1 | Array 1
1 | 3
7 | 2
Array 2 | Array 2
2 | 0
0 | 2
Formula | Formula
=MMULT(A2:B3,A5:B6) |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, 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 spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Array 1 | Array 1
3 | 0
2 | 0
Array 2 | Array 2
2 | 0
0 | 2
Formula | Formula
=MMULT(A2:B3,A5:B6) |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, 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.


MOD

Returns the remainder after number is divided by divisor. The result has the same sign as divisor.

Syntax

MOD(number,divisor)

Number is the number for which you want to find the remainder.

Divisor is the number by which you want to divide number.

Remarks

  • If divisor is 0, MOD returns the #DIV/0! error value.

  • The MOD function can be expressed in terms of the INT function:

    MOD(n, d) = n - d*INT(n/d)

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=MOD(3, 2) | Remainder of 3/2. (1)
=MOD(-3, 2) | Remainder of -3/2. The sign is the same as divisor. (1)
=MOD(3, -2) | Remainder of 3/-2. The sign is the same as divisor. (-1)
=MOD(-3, -2) | Remainder of -3/-2. The sign is the same as divisor. (-1)


ODD

Returns number rounded up to the nearest odd integer.

Syntax

ODD(number)

Number is the value to round.

Remarks

  • If number is nonnumeric, ODD returns the #VALUE! error value.
  • Regardless of the sign of number, a value is rounded up when adjusted away from zero. If number is an odd integer, no rounding occurs.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ODD(1.5) | Rounds 1.5 up to the nearest odd integer (3)
=ODD(3) | Rounds 3 up to the nearest odd integer (3)
=ODD(2) | Rounds 2 up to the nearest odd integer (3)
=ODD(-1) | Rounds -1 up to the nearest odd integer (-1)
=ODD(-2) | Rounds -2 up to the nearest odd integer (-3)


PI

Returns the number 3.14159265358979, the mathematical constant pi, accurate to 15 digits.

Syntax

PI( )

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Radius
3
Formula | Description (Result)
=PI() | Pi (3.14159265358979)
=PI()/2 | Pi/2 (1.570796327)
=PI()*(A2^2) | Area of a circle, with the radius above (28.27433388)


POWER

Returns the result of a number raised to a power.

Syntax

POWER(number,power)

Number is the base number. It can be any real number.

Power is the exponent to which the base number is raised.

Remark

The "^" operator can be used instead of POWER to indicate to what power the base number is to be raised, such as in 5^2.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=POWER(5,2) | 5 squared (25)
=POWER(98.6,3.2) | 98.6 raised to the power of 3.2 (2401077)
=POWER(4,5/4) | 4 raised to the power of 5/4 (5.656854)


PRODUCT

Multiplies all the numbers given as arguments and returns the product.

Syntax

PRODUCT(number1,number2,...)

Number1, number2, ... are 1 to 30 numbers that you want to multiply.

Remarks

  • Arguments that are numbers, logical values, or text representations of numbers are counted; arguments that are error values or text that cannot be translated into numbers cause errors.
  • If an argument is an array or reference, only numbers in the array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
5
15
30
Formula | Description (Result)
=PRODUCT(A2:A4) | Multiplies the numbers above (2250)
=PRODUCT(A2:A4,2) | Multiplies the numbers above and 2 (4500)


RADIANS

Converts degrees to radians.

Syntax

RADIANS(angle)

Angle is an angle in degrees that you want to convert.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=RADIANS(270) | 270 degrees as radians (4.712389 or 3π/2 radians)


RAND

Returns an evenly distributed random number greater than or equal to 0 and less than 1. A new random number is returned every time the spreadsheet is calculated.

Syntax

RAND( )

Remarks

  • To generate a random real number between a and b, use:

    RAND()*(b-a)+a

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=RAND() | A random number between 0 and 1 (varies)
=RAND()*100 | A random number equal to 0 but less than 100 (varies)


ROMAN

Converts an arabic numeral to roman, as text.

Syntax

ROMAN(number,form)

Number is the arabic numeral you want converted.

Form is a number specifying the type of roman numeral you want. The roman numeral style ranges from Classic to Simplified, becoming more concise as the value of form increases. See the example following ROMAN(499,0) below.

Form | Type
0 or omitted | Classic.
1 | More concise. See example below.
2 | More concise. See example below.
3 | More concise. See example below.
4 | Simplified.
TRUE | Classic.
FALSE | Simplified.

Remarks

  • If number is negative, the #VALUE! error value is returned.
  • If number is greater than 3999, the #VALUE! error value is returned.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROMAN(499,0) | Classic roman numeral style for 499 (CDXCIX)
=ROMAN(499,1) | More concise version for 499 (LDVLIV)
=ROMAN(499,2) | More concise version for 499 (XDIX)
=ROMAN(499,3) | More concise version for 499 (VDIV)
=ROMAN(499,4) | More concise version for 499 (ID)
=ROMAN(2013,0) | Classic roman numeral style for 2013 (MMXIII)


ROUND

Some of the content in this topic may not be applicable to some languages.

Rounds a number to a specified number of digits.

Syntax

ROUND(number,num_digits)

Number is the number you want to round.

Num_digits specifies the number of digits to which you want to round the number.

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, then number is rounded to the nearest integer.
  • If num_digits is less than 0, then number is rounded to the left of the decimal point.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROUND(2.15, 1) | Rounds 2.15 to one decimal place (2.2)
=ROUND(2.149, 1) | Rounds 2.149 to one decimal place (2.1)
=ROUND(-1.475, 2) | Rounds -1.475 to two decimal places (-1.48)
=ROUND(21.5, -1) | Rounds 21.5 to one decimal place to the left of the decimal point (20)


ROUNDDOWN

Rounds a number down, toward zero.

Syntax

ROUNDDOWN(number,num_digits)

Number is any real number that you want rounded down.

Num_digits is the number of digits to which you want to round the number.

Remarks

  • ROUNDDOWN behaves like ROUND, except that it always rounds a number down.
  • If num_digits is greater than 0 (zero), then number is rounded down to the specified number of decimal places.
  • If num_digits is 0, then number is rounded down to the nearest integer.
  • If num_digits is less than 0, then number is rounded down to the left of the decimal point.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROUNDDOWN(3.2, 0) | Rounds 3.2 down to zero decimal places (3)
=ROUNDDOWN(76.9,0) | Rounds 76.9 down to zero decimal places (76)
=ROUNDDOWN(3.14159, 3) | Rounds 3.14159 down to three decimal places (3.141)
=ROUNDDOWN(-3.14159, 1) | Rounds -3.14159 down to one decimal place (-3.1)
=ROUNDDOWN(31415.92654, -2) | Rounds 31415.92654 down to 2 decimal places to the left of the decimal (31400)


ROUNDUP

Rounds a number up, away from 0 (zero).

Syntax

ROUNDUP(number,num_digits)

Number is any real number that you want rounded up.

Num_digits is the number of digits to which you want to round the number.

Remarks

  • ROUNDUP behaves like ROUND, except that it always rounds a number up.

  • If num_digits is greater than 0 (zero), then number is rounded up to the specified number of decimal places.

  • If num_digits is 0, then number is rounded up to the nearest integer.

  • If num_digits is less than 0, then number is rounded up to the left of the decimal point.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=ROUNDUP(3.2,0) | Rounds 3.2 up to zero decimal places (4)
=ROUNDUP(76.9,0) | Rounds 76.9 up to zero decimal places (77)
=ROUNDUP(3.14159,3) | Rounds 3.14159 up to three decimal places (3.142)
=ROUNDUP(-3.14159,1) | Rounds -3.14159 up to one decimal place (-3.2)
=ROUNDUP(31415.92654,-2) | Rounds 31415.92654 up to 2 decimal places to the left of the decimal (31500)


SIGN

Determines the sign of a number. Returns 1 if the number is positive, zero (0) if the number is 0, and -1 if the number is negative.

Syntax

SIGN(number)

Number is any real number.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=SIGN(10) | Sign of a positive number (1)
=SIGN(4-4) | Sign of zero (0)
=SIGN(-0.00001) | Sign of a negative number (-1)


SIN

Returns the sine of the given angle.

Syntax

SIN(number)

Number is the angle in radians for which you want the sine.

Remark

If your argument is in degrees, multiply it by PI()/180 or use the RADIANS function to convert it to radians.

Example

The example may be easier to understand if you copy it to a blank worksheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=SIN(PI()) | Sine of pi radians (0, approximately)
=SIN(PI()/2) | Sine of pi/2 radians (1)
=SIN(30*PI()/180) | Sine of 30 degrees (0.5)
=SIN(RADIANS(30)) | Sine of 30 degrees (0.5)


SINH

Returns the hyperbolic sine of a number.

Syntax

SINH(number)

Number is any real number.

Remark

The formula for the hyperbolic sine is:

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=SINH(1) | Hyperbolic sine of 1 (1.175201194)
=SINH(-1) | Hyperbolic sine of -1 (-1.175201194)

Example 2

You can use the hyperbolic sine function to approximate a cumulative probability distribution. Suppose a laboratory test value varies between 0 and 10 seconds. An empirical analysis of the collected history of experiments shows that the probability of obtaining a result, x, of less than t seconds is approximated by the following equation:

P(x<t) = 2.868 * SINH(0.0342 * t), where 0<t<10

To calculate the probability of obtaining a result of less than 1.03 seconds, substitute 1.03 for t.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=2.868*SINH(0.0342*1.03) | Probability of obtaining a result of less than 1.03 seconds (0.101049063)

You can expect this result to occur about 101 times for every 1000 experiments.


SQRT

Returns a positive square root.

Syntax

SQRT(number)

Number is 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 spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
-16
Formula | Description (Result)
=SQRT(16) | Square root of 16 (4)
=SQRT(A2) | Square root of the number above. Because the number is negative, an error is returned (#NUM!)
=SQRT(ABS(A2)) | Square root of the absolute value of the number above (4)


SUBTOTAL

Returns a subtotal in a list or database. Once the subtotal list is created, you can modify it by editing the SUBTOTAL function.

Syntax

SUBTOTAL(function_num,ref1,ref2,...)

Function_num is the number from 1 to 11 that specifies which function to use in calculating subtotals within a list.

Function_Num | Function
1 | AVERAGE
2 | COUNT
3 | COUNTA
4 | MAX
5 | MIN
6 | PRODUCT
7 | STDEV
8 | STDEVP
9 | SUM
10 | VAR
11 | VARP

Ref1, ref2, ... are 1 to 29 ranges or references for which you want the subtotal.

Remarks

  • If there are other subtotals within ref1, ref2, … (or nested subtotals), these nested subtotals are ignored to avoid double counting.
  • SUBTOTAL will ignore any hidden rows that result from a list being filtered. This is important when you want to subtotal only the visible data that results from a list that you have filtered.
  • If any of the references are 3-D references, SUBTOTAL returns the #VALUE! error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
120
10
150
23
Formula | Description (Result)
=SUBTOTAL(9,A2:A5) | Subtotal of the column above using the SUM function (303)
=SUBTOTAL(1,A2:A5) | Subtotal of the column above using the AVERAGE function (75.75)


SUM

Adds all the numbers in a range of cells.

Syntax

SUM(number1,number2,...)

Number1, number2, ... are 1 to 30 arguments for which you want the total value or sum.

Remarks

  • Numbers, logical values, and text representations of numbers that you type directly into the list of arguments are counted. See the first and second examples following.
  • 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. See the third example following.
  • Arguments cause errors if they are error values or text that cannot be translated into numbers.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
-5
15
30
'5
TRUE
Formula | Description (Result)
=SUM(3, 2) | Adds 3 and 2 (5)
=SUM("5", 15, TRUE) | Adds 5, 15 and 1, because the text values are translated into numbers, and the logical value TRUE is translated into the number 1 (21)
=SUM(A2:A4) | Adds the first three numbers in the column above (40)
=SUM(A2:A4, 15) | Adds the first three numbers in the column above, and 15 (55)
=SUM(A5,A6, 2) | Adds the values in the last two rows above, and 2. Because nonnumeric values in references are not translated, the values in the column above are ignored (2)


SUMIF

Adds the cells specified by a given criteria.

Syntax

SUMIF(range,criteria,sum_range)

Range is the range of cells you want evaluated.

Criteria is the criteria in the form of a number, expression, or text that defines which cells will be added. For example, criteria can be expressed as 32, "32", ">32", and "apples".

Sum_range are the actual cells to sum.

Remarks

  • The cells in sum_range are summed only if their corresponding cells in range match the criteria.

  • If sum_range is omitted, the cells in range are summed.

  • Additional functions that can be used to analyze your data based on a condition are available. For example, to count the number of occurrences of a string of text or a number within a range of cells, use the COUNTIF function. To have a formula return one of two values based on a condition, such as a sales bonus based on a specified sales amount, use the IF function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Property Value | Commission
100,000 | 7,000
200,000 | 14,000
300,000 | 21,000
400,000 | 28,000
Formula | Description (Result)
=SUMIF(A2:A5,">160000",B2:B5) | Sum of the commissions for property values over 160000 (63,000)


SUMPRODUCT

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

Syntax

SUMPRODUCT(array1,array2,array3,...)

Array1, array2, array3, ... are 2 to 30 arrays 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

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Array 1 | Array 1 | Array 2 | Array 2
3 | 4 | 2 | 7
8 | 6 | 6 | 7
1 | 9 | 5 | 3
Formula | Description (Result)
=SUMPRODUCT(A2:B4, C2:D4) | Multiplies all the components of the two arrays and then adds the products— that is, 3*2 + 4*7 + 8*6 + 6*7 + 1*5 + 9*3. (156)

Note The preceding example returns the same result as the formula SUM(A2:B4*C2:D4) entered as an array. 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.


SUMSQ

Returns the sum of the squares of the arguments.

Syntax

SUMSQ(number1,number2,...)

Number1, number2, ... are 1 to 30 arguments for which you want the sum of the squares. You can also use a single array or a reference to an array instead of arguments separated by commas.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=SUMSQ(3, 4) | Sum of the squares of 3 and 4 (25)


SUMX2MY2

Returns the sum of the difference of squares of the corresponding values in two arrays.

Syntax

SUMX2MY2(array_x,array_y)

Array_x is the first array or range of values.

Array_y is the second array or range of values.

Remarks

  • The arguments should either be numbers or be names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If array_x and array_y have a different number of values, SUMX2MY2 returns the #N/A error value.
  • The equation for the sum of the difference of squares is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
First array | Second array
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
7 | 4
5 | 4
Formula | Description (Result)
=SUMX2MY2(A2:A8,B2:B8) | Sum of the difference of squares of the two arrays above (-55)
=SUMX2MY2({2, 3, 9, 1, 8, 7, 5},{6, 5, 11, 7, 5, 4, 4}) | Sum of the difference of squares of the two arrays constants (-55)


SUMX2PY2

Returns the sum of the sum of squares of corresponding values in two arrays. The sum of the sum of squares is a common term in many statistical calculations.

Syntax

SUMX2PY2(array_x,array_y)

Array_x is the first array or range of values.

Array_y is the second array or range of values.

Remarks

  • The arguments should either be numbers or be names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If array_x and array_y have a different number of values, SUMX2PY2 returns the #N/A error value.
  • The equation for the sum of the sum of squares is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
First array | Second array
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
7 | 4
5 | 4
Formula | Description (Result)
=SUMX2PY2(A2:A8,B2:B8) | Sum of the sum of squares of the two arrays above (521)
=SUMX2PY2({2, 3, 9, 1, 8, 7, 5},{6, 5, 11, 7, 5, 4, 4}) | Sum of the sum of squares of the two array constants (521)


SUMXMY2

Returns the sum of squares of the differences of corresponding values in two arrays.

Syntax

SUMXMY2(array_x,array_y)

Array_x is the first array or range of values.

Array_y is the second array or range of values.

Remarks

  • The arguments should either be numbers or be names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If array_x and array_y have a different number of values, SUMXMY2 returns the #N/A error value.
  • The equation for the sum of squared differences is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
First array | Second array
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
7 | 4
5 | 4
Formula | Description (Result)
=SUMXMY2(A2:A8,B2:B8) | Sum of the squares of the differences of the two arrays above (79)
=SUMXMY2({2, 3, 9, 1, 8, 7, 5},{6, 5, 11, 7, 5, 4, 4}) | Sum of the squares of the differences of the two array constants (79)


TAN

Returns the tangent of the given angle.

Syntax

TAN(number)

Number is the angle in radians for which you want the tangent.

Remark

If your argument is in degrees, multiply it by PI()/180 or use the RADIANS function to convert it to radians.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=TAN(0.785) | Tangent of 0.785 radians (0.99920)
=TAN(45*PI()/180) | Tangent of 45 degrees (1)
=TAN(RADIANS(45)) | Tangent of 45 degrees (1)


TANH

Returns the hyperbolic tangent of a number.

Syntax

TANH(number)

Number is any real number.

Remark

The formula for the hyperbolic tangent is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=TANH(-2) | Hyperbolic tangent of -2 (-0.96403)
=TANH(0) | Hyperbolic tangent of 0 (0)
=TANH(0.5) | Hyperbolic tangent of 0.5 (0.462117)


TRUNC

Truncates a number to an integer by removing the fractional part of the number.

Syntax

TRUNC(number,num_digits)

Number is the number you want to truncate.

Num_digits is a number specifying the precision of the truncation. The default value for num_digits is 0 (zero).

Remark

TRUNC and INT are similar in that both return integers. TRUNC removes the fractional part of the number. INT rounds numbers down to the nearest integer based on the value of the fractional part of the number. INT and TRUNC are different only when using negative numbers: TRUNC(-4.3) returns -4, but INT(-4.3) returns -5 because -5 is the lower number.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=TRUNC(8.9) | Integer part of 8.9 (8)
=TRUNC(-8.9) | Integer part of -8.9 (-8)
=TRUNC(PI()) | Integer part of pi (3)


CREATEOBJECT

This function is no longer supported.


HOST

This function is no longer supported.


OBJECT

This function is no longer supported.


XMLDOM

This function is no longer supported.


AVEDEV

Returns the average of the absolute deviations of data points from their mean. AVEDEV is a measure of the variability in a data set.

Syntax

AVEDEV(number1,number2, ...)

Number1, number2, ... are 1 to 30 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • The equation for average deviation is:

AVEDEV is influenced by the unit of measurement in the input data.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
4
5
6
7
5
4
3
Formula | Description (Result)
=AVEDEV(A2:A8) | Average of the absolute deviations of the numbers above from their mean (1.020408)


AVERAGE

Returns the average (arithmetic mean) of the arguments.

Syntax

AVERAGE(number1,number2, ...)

Number1, number2, ... are 1 to 30 numeric arguments for which you want the average.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
10
7
9
27
2
Formula | Description (Result)
=AVERAGE(A2:A6) | Average of the numbers above (11)
=AVERAGE(A2:A6, 5) | Average of the numbers above and 5 (10)


AVERAGEA

Calculates the average (arithmetic mean) of the values in the list of arguments. Unlike the AVERAGE functions, text and logical values such as TRUE and FALSE are included in the calculation.

Syntax

AVERAGEA(value1,value2, ...)

Value1, value2,... are 1 to 30 cells, ranges of cells, or values for which you want the average.

Remarks

  • The arguments must be numbers, names, arrays, or references.
  • Array or reference arguments that contain text evaluate as 0 (zero). Empty text ("") evaluates as 0 (zero). If the calculation must not include text values in the average, use the AVERAGE function.
  • Arguments that contain TRUE evaluate as 1; arguments that contain FALSE evaluate as 0 (zero).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
10
7
9
2
Not available
Formula | Description (Result)
=AVERAGEA(A2:A6) | Average of the numbers above, and the text "Not available". The cell with the text "Not available" is used in the calculation (5.6)
=AVERAGEA(A2:A5,A7) | Average of the numbers above, and the empty cell (7)


BETADIST

Returns the cumulative beta probability density function. The cumulative beta probability density function is commonly used to study variation in the percentage of something across samples, such as the fraction of the day people spend watching television.

Syntax

BETADIST(x,alpha,beta,A,B)

X is the value between A and B at which to evaluate the function.

Alpha is a parameter to the distribution.

Beta is a parameter to the distribution.

A is an optional lower bound to the interval of x.

B is an optional upper bound to the interval of x.

Remarks

  • If any argument is nonnumeric, BETADIST returns the #VALUE! error value.
  • If alpha ≤ 0 or beta ≤ 0, BETADIST returns the #NUM! error value.
  • If x < A, x > B, or A = B, BETADIST returns the #NUM! error value.
  • If you omit values for A and B, BETADIST uses the standard cumulative beta distribution, so that A = 0 and B = 1.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
2 | Value at which to evaluate the function
8 | Parameter to the distribution
10 | Parameter to the distribution
1 | Lower bound
3 | Upper bound
Formula | Description (Result)
=BETADIST(A2,A3,A4,A5,A6) | Cumulative beta probability density function, for the above parameters (0.685470581)


BETAINV

Returns the inverse of the cumulative beta probability density function. That is, if probability = BETADIST(x,...), then BETAINV(probability,...) = x. The cumulative beta distribution can be used in project planning to model probable completion times given an expected completion time and variability.

Syntax

BETAINV(probability,alpha,beta,A,B)

Probability is a probability associated with the beta distribution.

Alpha is a parameter to the distribution.

Beta is a parameter to the distribution.

A is an optional lower bound to the interval of x.

B is an optional upper bound to the interval of x.

Remarks

  • If any argument is nonnumeric, BETAINV returns the #VALUE! error value.
  • If alpha ≤ 0 or beta ≤ 0, BETAINV returns the #NUM! error value.
  • If probability ≤ 0 or probability > 1, BETAINV returns the #NUM! error value.
  • If you omit values for A and B, BETAINV uses the standard cumulative beta distribution, so that A = 0 and B = 1.

BETAINV uses an iterative technique for calculating the function. Given a probability value, BETAINV iterates until the result is accurate to within ±3x10-7. If BETAINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.685470581 | Probability associated with the beta distribution
8 | Parameter to the distribution
10 | Parameter to the distribution
1 | Lower bound
3 | Upper bound
Formula | Description (Result)
=BETAINV(A2,A3,A4,A5,A6) | Inverse of the cumulative beta probability density function for the parameters above (2)


BINOMDIST

Returns the individual term binomial distribution probability. Use BINOMDIST in problems with a fixed number of tests or trials, when the outcomes of any trial are only success or failure, when trials are independent, and when the probability of success is constant throughout the experiment. For example, BINOMDIST can calculate the probability that two of the next three babies born are male.

Syntax

BINOMDIST(number_s,trials,probability_s,cumulative)

Number_s is the number of successes in trials.

Trials is the number of independent trials.

Probability_s is the probability of success on each trial.

Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, then BINOMDIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function, which is the probability that there are exactly number_s successes.

Remarks

  • Number_s and trials are truncated to integers.
  • If number_s, trials, or probability_s is nonnumeric, BINOMDIST returns the #VALUE! error value.
  • If number_s < 0 or number_s > trials, BINOMDIST returns the #NUM! error value.
  • If probability_s < 0 or probability_s > 1, BINOMDIST returns the #NUM! error value.
  • The binomial probability mass function is:

    where:

    is COMBIN(n,x).

    The cumulative binomial distribution is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
6 | Number of successes in trials
10 | Number of independent trials
0.5 | Probability of success on each trial
Formula | Description (Result)
=BINOMDIST(A2,A3,A4,FALSE) | Probability of exactly 6 of 10 trials being successful (0.205078)


CHIDIST

Returns the one-tailed probability of the chi-squared distribution. The γ2 distribution is associated with a γ2 test. Use the γ2 test to compare observed and expected values. For example, a genetic experiment might hypothesize that the next generation of plants will exhibit a certain set of colors. By comparing the observed results with the expected ones, you can decide whether your original hypothesis is valid.

Syntax

CHIDIST(x,degrees_freedom)

X is the value at which you want to evaluate the distribution.

Degrees_freedom is the number of degrees of freedom.

Remarks

  • If either argument is nonnumeric, CHIDIST returns the #VALUE! error value.
  • If x is negative, CHIDIST returns the #NUM! error value.
  • If degrees_freedom is not an integer, it is truncated.
  • If degrees_freedom < 1 or degrees_freedom ≥ 10^10, CHIDIST returns the #NUM! error value.
  • CHIDIST is calculated as CHIDIST = P(X>x), where X is a γ2 random variable.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
18.307 | Value at which you want to evaluate the distribution
10 | Degrees of freedom
Formula | Description (Result)
=CHIDIST(A2,A3) | One-tailed probability of the chi-squared distribution, for the above terms (0.050001)


CHIINV

Returns the inverse of the one-tailed probability of the chi-squared distribution. If probability = CHIDIST(x,...), then CHIINV(probability,...) = x. Use this function to compare observed results with expected ones to decide whether your original hypothesis is valid.

Syntax

CHIINV(probability,degrees_freedom)

Probability is a probability associated with the chi-squared distribution.

Degrees_freedom is the number of degrees of freedom.

Remarks

  • If either argument is nonnumeric, CHIINV returns the #VALUE! error value.
  • If probability < 0 or probability > 1, CHIINV returns the #NUM! error value.
  • If degrees_freedom is not an integer, it is truncated.
  • If degrees_freedom < 1 or degrees_freedom ≥ 10^10, CHIINV returns the #NUM! error value.

CHIINV uses an iterative technique for calculating the function. Given a probability value, CHIINV iterates until the result is accurate to within ± 3x10^-7. If CHIINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.05 | Probability associated with the chi-squared distribution
10 | Degrees of freedom
Formula | Description (Result)
=CHIINV(A2,A3) | Inverse of the one-tailed probability of the chi-squared distribution (18.30703)


CHITEST

Returns the test for independence. CHITEST returns the value from the chi-squared (γ2) distribution for the statistic and the appropriate degrees of freedom. You can use γ2 tests to determine whether hypothesized results are verified by an experiment.

Syntax

CHITEST(actual_range,expected_range)

Actual_range is the range of data that contains observations to test against expected values.

Expected_range is the range of data that contains the ratio of the product of row totals and column totals to the grand total.

Remarks

  • If actual_range and expected_range have a different number of data points, CHITEST returns the #N/A error value.
  • The γ2 test first calculates a γ2 statistic and then sums the differences of actual values from the expected values. The equation for this function is CHITEST=p( X>γ2 ), where:

    and where:

    Aij = actual frequency in the i-th row, j-th column

    Eij = expected frequency in the i-th row, j-th column

    r = number or rows

    c = number of columns

    CHITEST returns the probability for a γ2 statistic and degrees of freedom, df, where df = (r - 1)(c - 1).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Men (Actual) | Women (Actual) | Description
58 | 35 | Agree
11 | 25 | Neutral
10 | 23 | Disagree
Men (Expected) | Women (Expected) | Description
45.35 | 47.65 | Agree
17.56 | 18.44 | Neutral
16.09 | 16.91 | Disagree
Formula | Description (Result)
=CHITEST(A2:B4,A6:B8) | The γ2 statistic for the data above is 16.16957 with 2 degrees of freedom (0.000308)


CONFIDENCE

Returns the confidence interval for a population mean with a normal distribution. The confidence interval is a range on either side of a sample mean. For example, if you order a product through the mail, you can determine, with a particular level of confidence, the earliest and latest the product will arrive.

Syntax

CONFIDENCE(alpha,standard_dev,size)

Alpha is the significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.

Standard_dev is the population standard deviation for the data range and is assumed to be known.

Size is the sample size.

Remarks

  • If any argument is nonnumeric, CONFIDENCE returns the #VALUE! error value.
  • If alpha ≤ 0 or alpha ≥ 1, CONFIDENCE returns the #NUM! error value.
  • If standard_dev ≤ 0, CONFIDENCE returns the #NUM! error value.
  • If size is not an integer, it is truncated.
  • If size < 1, CONFIDENCE returns the #NUM! error value.
  • If we assume alpha equals 0.05, we need to calculate the area under the standard normal curve that equals (1 - alpha), or 95 percent. This value is ± 1.96. The confidence interval is therefore:

Example

Suppose we observe that, in our sample of 50 commuters, the average length of travel to work is 30 minutes with a population standard deviation of 2.5. We can be 95 percent confident that the population mean is in the interval:

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.05 | Significance level
2.5 | Standard deviation of the population
50 | Sample size
Formula | Description (Result)
=CONFIDENCE(A2,A3,A4) | Confidence interval for a population mean. In other words, the average length of travel to work equals 30 ± 0.692951 minutes, or 29.3 to 30.7 minutes. (0.692951)


CORREL

Returns the correlation coefficient of the array1 and array2 cell ranges. Use the correlation coefficient to determine the relationship between two properties. For example, you can examine the relationship between a location's average temperature and the use of air conditioners.

Syntax

CORREL(array1,array2)

Array1 is a cell range of values.

Array2 is a second cell range of values.

Remarks

  • The arguments must be numbers, or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If array1 and array2 have a different number of data points, CORREL returns the #N/A error value.
  • If either array1 or array2 is empty, or if s (the standard deviation) of their values equals zero, CORREL returns the #DIV/0! error value.
  • The equation for the correlation coefficient is:

    where:

    and:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data1 | Data2
3 | 9
2 | 7
4 | 12
5 | 15
6 | 17
Formula | Description (Result)
=CORREL(A2:A6,B2:B6) | Correlation coefficient of the two data sets above (0.997054)


COUNT

Counts the number of cells that contain numbers and numbers within the list of arguments. Use COUNT to get the number of entries in a number field in a range or array of numbers.

Syntax

COUNT(value1,value2, ...)

Value1, value2, ... are 1 to 30 arguments that can contain or refer to a variety of different types of data, but only numbers are counted.

Remarks

  • Arguments that are numbers, dates, or text representations of numbers are counted; arguments that are error values or text that cannot be translated into numbers are ignored.
  • 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. If you need to count logical values, text, or error values, use the COUNTA function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Sales
12/8/2008
19
22.24
TRUE
#DIV/0!
Formula | Description (Result)
=COUNT(A2:A8) | Counts the number of cells that contain numbers in the list above (3)
=COUNT(A5:A8) | Counts the number of cells that contain numbers in the last 4 rows of the list (2)
=COUNT(A2:A8,2) | Counts the number of cells that contain numbers in the list, and the value 2 (4)


COUNTA

Counts the number of cells that are not empty and the values within the list of arguments. Use COUNTA to count the number of cells that contain data in a range or array.

Syntax

COUNTA(value1,value2, ...)

Value1, value2, ... are 1 to 30 arguments representing the values you want to count. In this case, a value is any type of information, including empty text ("") but not including empty cells. If an argument is an array or reference, empty cells within the array or reference are ignored. If you do not need to count logical values, text, or error values, use the COUNT function.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Sales
12/8/2008
19
22.24
TRUE
#DIV/0!
Formula | Description (Result)
=COUNTA(A2:A8) | Counts the number of nonblank cells in the list above (6)
=COUNTA(A5:A8) | Counts the number of nonblank cells in the last 4 rows of the list (4)
=COUNTA(A1:A7, 2) | Counts the number of nonblank cells in the list above and the value 2 (7)
=COUNTA(A1:A7, "Two") | Counts the number of nonblank cells in the list above and the value "Two" (7)


COVAR

Returns covariance, the average of the products of deviations for each data point pair. Use covariance to determine the relationship between two data sets. For example, you can examine whether greater income accompanies greater levels of education.

Syntax

COVAR(array1,array2)

Array1 is the first cell range of integers.

Array2 is the second cell range of integers.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If array1 and array2 have different numbers of data points, COVAR returns the #N/A error value.
  • If either array1 or array2 is empty, COVAR returns the #DIV/0! error value.
  • The covariance is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data1 | Data2
3 | 9
2 | 7
4 | 12
5 | 15
6 | 17
Formula | Description (Result)
=COVAR(A2:A6, B2:B6) | Covariance, the average of the products of deviations for each data point pair above (5.2)


CRITBINOM

Returns the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value. Use this function for quality assurance applications. For example, use CRITBINOM to determine the greatest number of defective parts that are allowed to come off an assembly line run without rejecting the entire lot.

Syntax

CRITBINOM(trials,probability_s,alpha)

Trials is the number of Bernoulli trials.

Probability_s is the probability of a success on each trial.

Alpha is the criterion value.

Remarks

  • If any argument is nonnumeric, CRITBINOM returns the #VALUE! error value.
  • If trials is not an integer, it is truncated.
  • If trials < 0, CRITBINOM returns the #NUM! error value.
  • If probability_s is < 0 or probability_s > 1, CRITBINOM returns the #NUM! error value.
  • If alpha < 0 or alpha > 1, CRITBINOM returns the #NUM! error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
6 | Number of Bernoulli trials
0.5 | Probability of a success on each trial
0.75 | Criterion value
Formula | Description (Result)
=CRITBINOM(A2,A3,A4) | Smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value (4)


DEVSQ

Returns the sum of squares of deviations of data points from their sample mean.

Syntax

DEVSQ(number1,number2, ...)

Number1,number2, ... are 1 to 30 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments must be numbers, or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • The equation for the sum of squared deviations is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
4
5
8
7
11
4
3
Formula | Description (Result)
=DEVSQ(A2:A8) | Sum of squares of deviations of data above from their sample mean (48)


EXPONDIST

Returns the exponential distribution. Use EXPONDIST to model the time between events, such as how long an automated bank teller takes to deliver cash. For example, you can use EXPONDIST to determine the probability that the process takes at most 1 minute.

Syntax

EXPONDIST(x,lambda,cumulative)

X is the value of the function.

Lambda is the parameter value.

Cumulative is a logical value that indicates which form of the exponential function to provide. If cumulative is TRUE, EXPONDIST returns the cumulative distribution function; if FALSE, it returns the probability density function.

Remarks

  • If x or lambda is nonnumeric, EXPONDIST returns the #VALUE! error value.
  • If x < 0, EXPONDIST returns the #NUM! error value.
  • If lambda ≤ 0, EXPONDIST returns the #NUM! error value.
  • The equation for the probability density function is:

  • The equation for the cumulative distribution function is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.2 | Value of the function
10 | Parameter value
Formula | Description (Result)
=EXPONDIST(A2,A3,TRUE) | Cumulative exponential distribution function (0.864665)
=EXPONDIST(0.2,10,FALSE) | Probability exponential distribution function (1.353353)


FDIST

Returns the F probability distribution. You can use this function to determine whether two data sets have different degrees of diversity. For example, you can examine test scores given to men and women entering high school and determine if the variability in the females is different from that found in the males.

Syntax

FDIST(x,degrees_freedom1,degrees_freedom2)

X is the value at which to evaluate the function.

Degrees_freedom1 is the numerator degrees of freedom.

Degrees_freedom2 is the denominator degrees of freedom.

Remarks

  • If any argument is nonnumeric, FDIST returns the #VALUE! error value.
  • If x is negative, FDIST returns the #NUM! error value.
  • If degrees_freedom1 or degrees_freedom2 is not an integer, it is truncated.
  • If degrees_freedom1 < 1 or degrees_freedom1 ≥ 10^10, FDIST returns the #NUM! error value.
  • If degrees_freedom2 < 1 or degrees_freedom2 ≥ 10^10, FDIST returns the #NUM! error value.
  • FDIST is calculated as FDIST=P( F<x ), where F is a random variable that has an F distribution.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
15.20675 | Value at which to evaluate the function
6 | Numerator degrees of freedom
4 | Denominator degrees of freedom
Formula | Description (Result)
=FDIST(A2,A3,A4) | F probability distribution for the terms above (0.01)


FINV

Returns the inverse of the F probability distribution. If p = FDIST(x,...), then FINV(p,...) = x.

The F distribution can be used in an F-test that compares the degree of variability in two data sets. For example, you can analyze income distributions in the United States and Canada to determine whether the two countries have a similar degree of diversity.

Syntax

FINV(probability,degrees_freedom1,degrees_freedom2)

Probability is a probability associated with the F cumulative distribution.

Degrees_freedom1 is the numerator degrees of freedom.

Degrees_freedom2 is the denominator degrees of freedom.

Remarks

  • If any argument is nonnumeric, FINV returns the #VALUE! error value.
  • If probability < 0 or probability > 1, FINV returns the #NUM! error value.
  • If degrees_freedom1 or degrees_freedom2 is not an integer, it is truncated.
  • If degrees_freedom1 < 1 or degrees_freedom1 ≥ 10^10, FINV returns the #NUM! error value.
  • If degrees_freedom2 < 1 or degrees_freedom2 ≥ 10^10, FINV returns the #NUM! error value.

FINV can be used to return critical values from the F distribution. For example, the output of an ANOVA calculation often includes data for the F statistic, F probability, and F critical value at the 0.05 significance level. To return the critical value of F, use the significance level as the probability argument to FINV.

FINV uses an iterative technique for calculating the function. Given a probability value, FINV iterates until the result is accurate to within ± 3x10^-7. If FINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.01 | Probability associated with the F cumulative distribution
6 | Numerator degrees of freedom
4 | Denominator degrees of freedom
Formula | Description (Result)
=FINV(A2,A3,A4) | Inverse of the F probability distribution for the terms above (15.20675)


FISHER

Returns the Fisher transformation at x. This transformation produces a function that is approximately normally distributed rather than skewed. Use this function to perform hypothesis testing on the correlation coefficient.

Syntax

FISHER(x)

X is a numeric value for which you want the transformation.

Remarks

  • If x is nonnumeric, FISHER returns the #VALUE! error value.
  • If x ≤ -1 or if x ≥ 1, FISHER returns the #NUM! error value.

  • The equation for the Fisher transformation is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=FISHER(0.75) | Fisher transformation at 0.75 (0.972955)


FISHERINV

Returns the inverse of the Fisher transformation. Use this transformation when analyzing correlations between ranges or arrays of data. If y = FISHER(x), then FISHERINV(y) = x.

Syntax

FISHERINV(y)

Y is the value for which you want to perform the inverse of the transformation.

Remarks

  • If y is nonnumeric, FISHERINV returns the #VALUE! error value.

  • The equation for the inverse of the Fisher transformation is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=FISHERINV(0.972955) | Inverse of the Fisher transformation at 0.972955 (0.75)


FORECAST

Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value. The known values are existing x-values and y-values, and the new value is predicted by using linear regression. You can use this function to predict future sales, inventory requirements, or consumer trends.

Syntax

FORECAST(x,known_y's,known_x's)

X is the data point for which you want to predict a value.

Known_y's is the dependent array or range of data.

Known_x's is the independent array or range of data.

Remarks

  • If x is nonnumeric, FORECAST returns the #VALUE! error value.
  • If known_y's and known_x's are empty or contain a different number of data points, FORECAST returns the #N/A error value.
  • If the variance of known_x's equals zero, then FORECAST returns the #DIV/0! error value.
  • The equation for FORECAST is a+bx, where:

    and:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known Y | Known X
6 | 20
7 | 28
9 | 31
15 | 38
21 | 40
Formula | Description (Result)
=FORECAST(30,A2:A6,B2:B6) | Predicts a value for y given an x value of 30 (10.60725)


FREQUENCY

Calculates how often values occur within a range of values, and then returns a vertical array of numbers. For example, use FREQUENCY to count the number of test scores that fall within ranges of scores. Because FREQUENCY returns an array, it must be entered as an array formula.

Syntax

FREQUENCY(data_array,bins_array)

Data_array is an array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.

Bins_array is an array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.

Remarks

  • FREQUENCY is entered as an array formula after you select a range of adjacent cells into which you want the returned distribution to appear.
  • The number of elements in the returned array is one more than the number of elements in bins_array. The extra element in the returned array returns the count of any values above the highest interval. For example, when counting three ranges of values (intervals) that are entered into three cells, be sure to enter FREQUENCY into four cells for the results. The extra cell returns the number of values in data_array that are greater than the third interval value.
  • FREQUENCY ignores blank cells and text.
  • Formulas that return arrays must be entered as array formulas.

Example

This example assumes all test scores are integers.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Scores | Bins
79 | 70
85 | 79
78 | 89
85 |
50 |
81 |
95 |
88 |
97 |
Formula | Description (Result)
=FREQUENCY(A2:A10,B2:B5) | Number of scores less than or equal to 70 (1)
 | Number of scores in the bin 71-79 (2)
 | Number of scores in the bin 80-89 (4)
 | Number of scores greater than or equal to 90 (2)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A12:A15 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 1.


FTEST

Returns the result of an F-test. An F-test returns the one-tailed probability that the variances in array1 and array2 are not significantly different. Use this function to determine whether two samples have different variances. For example, given test scores from public and private schools, you can test whether these schools have different levels of diversity.

Syntax

FTEST(array1,array2)

Array1 is the first array or range of data.

Array2 is the second array or range of data.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If the number of data points in array1 or array2 is less than 2, or if the variance of array1 or array2 is zero, FTEST returns the #DIV/0! error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data1 | Data2
6 | 20
7 | 28
9 | 31
15 | 38
21 | 40
Formula | Description (Result)
=FTEST(A2:A6,B2:B6) | F-test for the data sets above (0.648318)


GAMMADIST

Returns the gamma distribution. You can use this function to study variables that may have a skewed distribution. The gamma distribution is commonly used in queuing analysis.

Syntax

GAMMADIST(x,alpha,beta,cumulative)

X is the value at which you want to evaluate the distribution.

Alpha is a parameter to the distribution.

Beta is a parameter to the distribution. If beta = 1, GAMMADIST returns the standard gamma distribution.

Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, GAMMADIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.

Remarks

  • If x, alpha, or beta is nonnumeric, GAMMADIST returns the #VALUE! error value.
  • If x < 0, GAMMADIST returns the #NUM! error value.
  • If alpha ≤ 0 or if beta ≤ 0, GAMMADIST returns the #NUM! error value.
  • The equation for the gamma distribution is:

    The standard gamma distribution is:

  • When alpha = 1, GAMMADIST returns the exponential distribution with:

  • For a positive integer n, when alpha = n/2, beta = 2, and cumulative = TRUE, GAMMADIST returns (1 - CHIDIST(x)) with n degrees of freedom.
  • When alpha is a positive integer, GAMMADIST is also known as the Erlang distribution.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
10 | Value at which you want to evaluate the distribution
9 | Alpha parameter to the distribution
2 | Beta parameter to the distribution
Formula | Description (Result)
=GAMMADIST(A2,A3,A4,FALSE) | Probability gamma distribution with the terms above (0.032639)
=GAMMADIST(A2,A3,A4,TRUE) | Cumulative gamma distribution with the terms above (0.068094)


GAMMAINV

Returns the inverse of the gamma cumulative distribution. If p = GAMMADIST(x,...), then GAMMAINV(p,...) = x.

You can use this function to study a variable whose distribution may be skewed.

Syntax

GAMMAINV(probability,alpha,beta)

Probability is the probability associated with the gamma distribution.

Alpha is a parameter to the distribution.

Beta is a parameter to the distribution. If beta = 1, GAMMAINV returns the standard gamma distribution.

Remarks

  • If any argument is nonnumeric, GAMMAINV returns the #VALUE! error value.
  • If probability < 0 or probability > 1, GAMMAINV returns the #NUM! error value.
  • If alpha ≤ 0 or if beta ≤ 0, GAMMAINV returns the #NUM! error value.

GAMMAINV uses an iterative technique for calculating the function. Given a probability value, GAMMAINV iterates until the result is accurate to within ±3x10^-7. If GAMMAINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.068094 | Probability associated with the gamma distribution
9 | Alpha parameter to the distribution
2 | Beta parameter to the distribution
Formula | Description (Result)
=GAMMAINV(A2,A3,A4) | Inverse of the gamma cumulative distribution for the above terms (10)


GAMMALN

Returns the natural logarithm of the gamma function, Γ(x).

Syntax

GAMMALN(x)

X is the value for which you want to calculate GAMMALN.

Remarks

  • If x is nonnumeric, GAMMALN returns the #VALUE! error value.
  • If x ≤ 0, GAMMALN returns the #NUM! error value.
  • The number e raised to the GAMMALN(i) power, where i is an integer, returns the same result as (i - 1)!.
  • GAMMALN is calculated as follows:

    where:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=GAMMALN(4) | Natural logarithm of the gamma function at 4 (1.791759)


GEOMEAN

Returns the geometric mean of an array or range of positive data. For example, you can use GEOMEAN to calculate average growth rate given compound interest with variable rates.

Syntax

GEOMEAN(number1,number2, ...)

Number1,number2, ... are 1 to 30 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If any data point ≤ 0, GEOMEAN returns the #NUM! error value.
  • The equation for the geometric mean is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
4
5
8
7
11
4
3
Formula | Description (Result)
=GEOMEAN(A2:A8) | Geometric mean of the data above (5.476987)


GROWTH

Calculates predicted exponential growth by using existing data. GROWTH returns the y-values for a series of new x-values that you specify by using existing x-values and y-values. You can also use the GROWTH spreadsheet function to fit an exponential curve to existing x-values and y-values.

Syntax

GROWTH(known_y's,known_x's,new_x's,const)

Known_y's is the set of y-values you already know in the relationship y = b*m^x.

  • If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.

  • If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.

  • If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.

Known_x's is an optional set of x-values that you may already know in the relationship y = b*m^x.

  • The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).

  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.

New_x's are new x-values for which you want GROWTH to return corresponding y-values.

  • New_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.

  • If new_x's is omitted, it is assumed to be the same as known_x's.

  • If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.

Const is a logical value specifying whether to force the constant b to equal 1.

  • If const is TRUE or omitted, b is calculated normally.

  • If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.

Remarks

  • Formulas that return arrays must be entered as array formulas after selecting the correct number of cells.
  • When entering an array constant for an argument such as known_x's, use commas to separate values in the same row and semicolons to separate rows.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.

This example uses the same data as the LOGEST example. The first formula shows corresponding values to the known values. The second formula predicts the next month's values, if the exponential trend continues.

Month | Units | Formula (Corresponding Units)
11 | 33,100 | =GROWTH(B2:B7,A2:A7)
12 | 47,300 |
13 | 69,000 |
14 | 102,000 |
15 | 150,000 |
16 | 220,000 |
Month | Formula (Predicted Units)
17 | =GROWTH(B2:B7,A2:A7, A9:A10)
18 |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range C2:C7 or B9:B10 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 results are 32618.20377 and 320196.7184.


HARMEAN

Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the arithmetic mean of reciprocals.

Syntax

HARMEAN(number1,number2, ...)

Number1,number2, ... are 1 to 30 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If any data point ≤ 0, HARMEAN returns the #NUM! error value.
  • The harmonic mean is always less than the geometric mean, which is always less than the arithmetic mean.
  • The equation for the harmonic mean is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
4
5
8
7
11
4
3
Formula | Description (Result)
=HARMEAN(A2:A8) | Harmonic mean of a data set above (5.028376)


HYPGEOMDIST

Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of sample successes, given the sample size, population successes, and population size. Use HYPGEOMDIST for problems with a finite population, where each observation is either a success or a failure, and where each subset of a given size is chosen with equal likelihood.

Syntax

HYPGEOMDIST(sample_s,number_sample,population_s,number_population)

Sample_s is the number of successes in the sample.

Number_sample is the size of the sample.

Population_s is the number of successes in the population.

Number_population is the population size.

Remarks

  • All arguments are truncated to integers.
  • If any argument is nonnumeric, HYPGEOMDIST returns the #VALUE! error value.
  • If sample_s < 0 or sample_s is greater than the lesser of number_sample or population_s, HYPGEOMDIST returns the #NUM! error value.
  • If sample_s is less than the larger of 0 or (number_sample - number_population + population_s), HYPGEOMDIST returns the #NUM! error value.
  • If number_sample < 0 or number_sample > number_population, HYPGEOMDIST returns the #NUM! error value.
  • If population_s < 0 or population_s > number_population, HYPGEOMDIST returns the #NUM! error value.
  • If number_population < 0, HYPGEOMDIST returns the #NUM! error value.
  • The equation for the hypergeometric distribution is:

    where:

    x = sample_s

    n = number_sample

    M = population_s

    N = number_population

    HYPGEOMDIST is used in sampling without replacement from a finite population.

Example

A sampler of chocolates contains 20 pieces. Eight pieces are caramels, and the remaining 12 are nuts. If a person selects 4 pieces at random, the following function returns the probability that exactly 1 piece is a caramel.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
1 | Number of successes in the sample
4 | Sample size
8 | Number of successes in the population
20 | Population size
Formula | Description (Result)
=HYPGEOMDIST(A2,A3,A4,A5) | Hypergeometric distribution for sample and population above (0.363261)


INTERCEPT

Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values. The intercept point is based on a best-fit regression line plotted through the known x-values and known y-values. Use the intercept when you want to determine the value of the dependent variable when the independent variable is 0 (zero). For example, you can use the INTERCEPT function to predict a metal's electrical resistance at 0°C when your data points were taken at room temperature and higher.

Syntax

INTERCEPT(known_y's,known_x's)

Known_y's is the dependent set of observations or data.

Known_x's is the independent set of observations or data.

Remarks

  • The arguments should be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If known_y's and known_x's contain a different number of data points or contain no data points, INTERCEPT returns the #N/A error value.
  • The equation for the intercept of the regression line is:

    where the slope is calculated as:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known y | Known x
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
Formula | Description (Result)
=INTERCEPT(A2:A6, B2:B6) | Point at which a line will intersect the y-axis by using the x-values and y-values above (0.0483871)


KURT

Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness or flatness of a distribution compared with the normal distribution. Positive kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a relatively flat distribution.

Syntax

KURT(number1,number2, ...)

Number1,number2, ... are 1 to 30 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If there are fewer than four data points, or if the standard deviation of the sample equals zero, KURT returns the #DIV/0! error value.
  • Kurtosis is defined as:

    where:

    s is the sample standard deviation.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
3
4
5
2
3
4
5
6
4
7
Formula | Description (Result)
=KURT(A2:A11) | Kurtosis of a data set above (-0.1518)


LARGE

Returns the k-th largest value in a data set. You can use this function to select a value based on its relative standing. For example, you can use LARGE to return the highest, runner-up, or third-place score.

Syntax

LARGE(array,k)

Array is the array or range of data for which you want to determine the k-th largest value.

K is the position (from the largest) in the array or cell range of data to return.

Remarks

  • If array is empty, LARGE returns the #NUM! error value.
  • If k ≤ 0 or if k is greater than the number of data points, LARGE returns the #NUM! error value.

If n is the number of data points in a range, then LARGE(array,1) returns the largest value, and LARGE(array,n) returns the smallest value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
3 | 4
5 | 2
3 | 4
5 | 6
4 | 7
Formula | Description (Result)
=LARGE(A2:B6,3) | 3rd largest number in the numbers above (5)
=LARGE(A2:B6,7) | 7th largest number in the numbers above (4)


LINEST

Calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data, and returns an array that describes the line. Because this function returns an array of values, it must be entered as an array formula.

The equation for the line is:

y = mx + b

or

y = m1x1 + m2x2 + ... + b (if there are multiple ranges of x-values)

where the dependent y-value is a function of the independent x-values. The m-values are coefficients corresponding to each x-value, and b is a constant value. Note that y, x, and m can be vectors. The array that LINEST returns is {mn,mn-1,...,m1,b}. LINEST can also return additional regression statistics.

Syntax

LINEST(known_y's,known_x's,const,stats)

Known_y's is the set of y-values you already know in the relationship y = mx + b.

  • If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.

  • If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.

Known_x's is an optional set of x-values that you may already know in the relationship y = mx + b.

  • The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).

  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.

Const is a logical value specifying whether to force the constant b to equal 0.

  • If const is TRUE or omitted, b is calculated normally.

  • If const is FALSE, b is set equal to 0 and the m-values are adjusted to fit y = mx.

Stats is a logical value specifying whether to return additional regression statistics.

  • If stats is TRUE, LINEST returns the additional regression statistics, so the returned array is {mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r2,sey;F,df;ssreg,ssresid}.

  • If stats is FALSE or omitted, LINEST returns only the m-coefficients and the constant b.

The additional regression statistics are as follows.

Statistic | Description
se1,se2,...,sen | The standard error values for the coefficients m1,m2,...,mn.
Seb | The standard error value for the constant b (seb = #N/A when const is FALSE).
r2 | The coefficient of determination. Compares estimated and actual y-values, and ranges in value from 0 to 1. If it is 1, there is a perfect correlation in the sample— there is no difference between the estimated y-value and the actual y-value. At the other extreme, if the coefficient of determination is 0, the regression equation is not helpful in predicting a y-value. For information about how r2 is calculated, see "Remarks" later in this topic.
sey | The standard error for the y estimate.
F | The F statistic, or the F-observed value. Use the F statistic to determine whether the observed relationship between the dependent and independent variables occurs by chance.
df | The degrees of freedom. Use the degrees of freedom to help you find F-critical values in a statistical table. Compare the values you find in the table to the F statistic returned by LINEST to determine a confidence level for the model.
ssreg | The regression sum of squares.
ssresid | The residual sum of squares.

The following illustration shows the order in which the additional regression statistics are returned.

Remarks

  • You can describe any straight line with the slope and the y-intercept:

    Slope (m):
    To find the slope of a line, often written as m, take two points on the line, (x1,y1) and (x2,y2); the slope is equal to (y2 - y1)/(x2 - x1).

    Y-intercept (b):
    The y-intercept of a line, often written as b, is the value of y at the point where the line crosses the y-axis.

    The equation of a straight line is y = mx + b. Once you know the values of m and b, you can calculate any point on the line by plugging the y- or x-value into that equation. You can also use the TREND function.

  • When you have only one independent x-variable, you can obtain the slope and y-intercept values directly by using the following formulas:

    Slope:
    =INDEX(LINEST(known_y's,known_x's),1)

    Y-intercept:
    =INDEX(LINEST(known_y's,known_x's),2)

  • The accuracy of the line calculated by LINEST depends on the degree of scatter in your data. The more linear the data, the more accurate the LINEST model. LINEST uses the method of least squares for determining the best fit for the data. When you have only one independent x-variable, the calculations for m and b are based on the following formulas:

  • The line- and curve-fitting functions LINEST and LOGEST can calculate the best straight line or exponential curve that fits your data. However, you have to decide which of the two results best fits your data. You can calculate TREND(known_y's,known_x's) for a straight line, or GROWTH(known_y's, known_x's) for an exponential curve. These functions, without the new_x's argument, return an array of y-values predicted along that line or curve at your actual data points. You can then compare the predicted values with the actual values. You may want to chart them both for a visual comparison.
  • In regression analysis, the squared difference between the y-value estimated for that point and its actual y-value is calculated for each point. The sum of these squared differences is called the residual sum of squares. The sum of the squared differences between the actual y-values and the average of the y-values, which is called the total sum of squares (regression sum of squares + residual sum of squares), is then calculated. The smaller the residual sum of squares is, compared with the total sum of squares, the larger the value of the coefficient of determination, r2, which is an indicator of how well the equation resulting from the regression analysis explains the relationship among the variables.
  • Formulas that return arrays must be entered as array formulas.
  • When entering an array constant such as known_x's as an argument, use commas to separate values in the same row and semicolons to separate rows. Separator characters may be different depending on your locale setting in Regional Settings or Regional Options in Control Panel.
  • Note that the y-values predicted by the regression equation may not be valid if they are outside the range of the y-values you used to determine the equation.

Example 1 Slope and Y-Intercept

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known y | Known x
1 | 0
9 | 4
5 | 2
7 | 3
Formula | Formula
=LINEST(A2:A5,B2:B5,,FALSE) |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A7:B7 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.

When entered as an array, the slope (2) and the y-intercept (1) are returned.

Example 2 Simple Linear Regression

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Month | Sales
1 | 3100
2 | 4500
3 | 4400
4 | 5400
5 | 7500
6 | 8100
Formula | Description (Result)
=SUM(LINEST(B2:B7, A2:A7)*{9,1}) | Estimate sales for the ninth month (11000)

In general, SUM({m,b}*{x,1}) equals mx + b, the estimated y-value for a given x-value. You can also use the TREND function.

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the formula cell (A9). Press F2, and then press CTRL+SHIFT+ENTER.

Example 3 Multiple Linear Regression

Suppose a commercial developer is considering purchasing a group of small office buildings in an established business district.

The developer can use multiple linear regression analysis to estimate the value of an office building in a given area based on the following variables.

Variable | Refers to the
y | Assessed value of the office building
x1 | Floor space in square feet
x2 | Number of offices
x3 | Number of entrances
x4 | Age of the office building in years

This example assumes that a straight-line relationship exists between each independent variable (x1, x2, x3, and x4) and the dependent variable (y), the value of office buildings in the area.

The developer randomly chooses a sample of 11 office buildings from a possible 1,500 office buildings and obtains the following data. "Half an entrance" means an entrance for deliveries only.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Floor space (x1) | Offices (x2) | Entrances (x3) | Age (x4) | Assessed value (y)
2310 | 2 | 2 | 20 | 142,000
2333 | 2 | 2 | 12 | 144,000
2356 | 3 | 1.5 | 33 | 151,000
2379 | 3 | 2 | 43 | 150,000
2402 | 2 | 3 | 53 | 139,000
2425 | 4 | 2 | 23 | 169,000
2448 | 2 | 1.5 | 99 | 126,000
2471 | 2 | 2 | 34 | 142,900
2494 | 3 | 3 | 23 | 163,000
2517 | 4 | 4 | 55 | 169,000
2540 | 2 | 3 | 22 | 149,000
Formula
=LINEST(E2:E12,A2:D12,TRUE,TRUE)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A14:E18 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 -234.2371645.

When entered as an array, the following regression statistics are returned. Use this key to identify the statistic you want.

The multiple regression equation, y = m1*x1 + m2*x2 + m3*x3 + m4*x4 + b, can now be obtained using the values from row 14:

y = 27.64*x1 + 12,530*x2 + 2,553*x3+ 234.24*x4 + 52,318

The developer can now estimate the assessed value of an office building in the same area that has 2,500 square feet, three offices, and two entrances and is 25 years old, by using the following equation:

y = 27.64*2500 + 12530*3 + 2553*2 - 234.24*25 + 52318 = $158,261

Or you can copy the following table to cell A21 of the example workbook.

Floor space (x1) | Offices (x2) | Entrances (x3) | Age (x4) | Assessed value (y)
2500 | 3 | 2 | 25 | =$D$14*$A$22 +$C$14*$B$22 + $B$14*$C$22 +$A$14*$D$22 +$E$14

You can also use the TREND function to calculate this value.

Example 4 Using The F And R2 Statistics

In the previous example, the coefficient of determination, or r2, is 0.99675 (see cell A17 in the output for LINEST), which would indicate a strong relationship between the independent variables and the sale price. You can use the F statistic to determine whether these results, with such a high r2 value, occurred by chance.

Assume for the moment that in fact there is no relationship among the variables, but that you have drawn a rare sample of 11 office buildings that causes the statistical analysis to demonstrate a strong relationship. The term "Alpha" is used for the probability of erroneously concluding that there is a relationship.

There is a relationship among the variables if the F-observed statistic is greater than the F-critical value. The F-critical value can be obtained by referring to a table of F-critical values in many statistics textbooks. To read the table, assume a single-tailed test, use an Alpha value of 0.05, and for the degrees of freedom (abbreviated in most tables as v1 and v2), use v1 = k = 4 and v2 = n - (k + 1) = 11 - (4 + 1) = 6, where k is the number of variables in the regression analysis and n is the number of data points. The F-critical value is 4.53.

The F-observed value is 459.753674 (cell A18), which is substantially greater than the F-critical value of 4.53. Therefore, the regression equation is useful in predicting the assessed value of office buildings in this area.

Example 5 Calculating The T-Statistics

Another hypothesis test will determine whether each slope coefficient is useful in estimating the assessed value of an office building in example 3. For example, to test the age coefficient for statistical significance, divide -234.24 (age slope coefficient) by 13.268 (the estimated standard error of age coefficients in cell A15). The following is the t-observed value:

t = m4 ÷ se4 = -234.24 ÷ 13.268 = -17.7

If you consult a table in a statistics manual, you will find that t-critical, single tail, with 6 degrees of freedom and Alpha = 0.05 is 1.94. Because the absolute value of t, 17.7, is greater than 1.94, age is an important variable when estimating the assessed value of an office building. Each of the other independent variables can be tested for statistical significance in a similar manner. The following are the t-observed values for each of the independent variables.

Variable | t-observed value
Floor space | 5.1
Number of offices | 31.3
Number of entrances | 4.8
Age | 17.7

These values all have an absolute value greater than 1.94; therefore, all the variables used in the regression equation are useful in predicting the assessed value of office buildings in this area.


LOGEST

In regression analysis, calculates an exponential curve that fits your data and returns an array of values that describes the curve. Because this function returns an array of values, it must be entered as an array formula.

The equation for the curve is:

y = b*m^x or y = (b*(m1^x1)*(m2^x2)*_) (if there are multiple x-values)

where the dependent y-value is a function of the independent x-values. The m-values are bases corresponding to each exponent x-value, and b is a constant value. Note that y, x, and m can be vectors. The array that LOGEST returns is {mn,mn-1,...,m1,b}.

Syntax

LOGEST(known_y's,known_x's,const,stats)

Known_y's is the set of y-values you already know in the relationship y = b*m^x.

  • If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.

  • If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.

Known_x's is an optional set of x-values that you may already know in the relationship y = b*m^x.

  • The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of cells with a height of one row or a width of one column (which is also known as a vector).

  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.

Const is a logical value specifying whether to force the constant b to equal 1.

  • If const is TRUE or omitted, b is calculated normally.

  • If const is FALSE, b is set equal to 1, and the m-values are fitted to y = m^x.

Stats is a logical value specifying whether to return additional regression statistics.

  • If stats is TRUE, LOGEST returns the additional regression statistics, so the returned array is {mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r 2,sey; F,df;ssreg,ssresid}.

  • If stats is FALSE or omitted, LOGEST returns only the m-coefficients and the constant b.

For more information about additional regression statistics, see LINEST.

Remarks

  • The more a plot of your data resembles an exponential curve, the better the calculated line will fit your data. Like LINEST, LOGEST returns an array of values that describes a relationship among the values, but LINEST fits a straight line to your data; LOGEST fits an exponential curve. For more information, see LINEST.
  • When you have only one independent x-variable, you can obtain the slope (m) and y-intercept (b) values directly by using the following formulas:

    Slope (m):
    INDEX(LOGEST(known_y's,known_x's),1)

    Y-intercept (b):
    INDEX(LOGEST(known_y's,known_x's),2)

    You can use the y = b*m^x equation to predict future values of y, but the GROWTH function will do this for you. For more information, see GROWTH.

  • Formulas that return arrays must be entered as array formulas.
  • When entering an array constant such as known_x's as an argument, use commas to separate values in the same row and semicolons to separate rows. Separator characters may be different depending on your locale setting in Regional Settings or Regional Options in Control Panel.
  • You should note that the y-values predicted by the regression equation may not be valid if they are outside the range of y-values you used to determine the equation.

Example 1: m-coefficients and the constant b

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Month | Units
11 | 33,100
12 | 47,300
13 | 69,000
14 | 102,000
15 | 150,000
16 | 220,000
Formula | Formula
=LOGEST(B2:B7,A2:A7, TRUE, FALSE) |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A9:B10 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 1.463275628.

When entered as an array, the m-coefficients and the constant b are returned.

y = b*m1^x1

or using the values from the array:

y = 495.3 * 1.4633x

You can estimate sales for future months by substituting the month number for x in this equation, or you can use the GROWTH function.

Example 2: Full statistics

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Month | Units
11 | 33,100
12 | 47,300
13 | 69,000
14 | 102,000
15 | 150,000
16 | 220,000
Formula
=LOGEST(B2:B7,A2:A7, TRUE, TRUE)

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range A9:B13 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 1.463275628.

When entered as an array, the following regression statistics are returned. Use this key to identify the statistic you want.

You can use the additional regression statistics (cells A10:B13 in the above output array) to determine how useful the equation is for predicting future values.

Important The methods you use to test an equation using LOGEST are similar to the methods for LINEST. However, the additional statistics LOGEST returns are based on the following linear model:

ln y = x1 ln m1 + ... + xn ln mn + ln b

You should keep this in mind when you evaluate the additional statistics, especially the sei and seb values, which should be compared to ln mi and ln b, not to mi and b. For more information, consult an advanced statistics manual.


LOGINV

Returns the inverse of the lognormal cumulative distribution function of x, where ln(x) is normally distributed with parameters mean and standard_dev. If p = LOGNORMDIST(x,...) then LOGINV(p,...) = x.

Use the lognormal distribution to analyze logarithmically transformed data.

Syntax

LOGINV(probability,mean,standard_dev)

Probability is a probability associated with the lognormal distribution.

Mean is the mean of ln(x).

Standard_dev is the standard deviation of ln(x).

Remarks

  • If any argument is nonnumeric, LOGINV returns the #VALUE! error value.
  • If probability < 0 or probability > 1, LOGINV returns the #NUM! error value.
  • If standard_dev <= 0, LOGINV returns the #NUM! error value.

  • The inverse of the lognormal distribution function is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.039084 | Probability associated with the lognormal distribution
3.5 | Mean of ln(x)
1.2 | Standard deviation of ln(x)
Formula | Description (Result)
=LOGINV(A2, A3, A4) | Inverse of the lognormal cumulative distribution function for the terms above (4.000014)


LOGNORMDIST

Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed with the parameters mean and standard_dev. Use this function to analyze data that has been logarithmically transformed.

Syntax

LOGNORMDIST(x,mean,standard_dev)

X is the value at which to evaluate the function.

Mean is the mean of ln(x).

Standard_dev is the standard deviation of ln(x).

Remarks

  • If any argument is nonnumeric, LOGNORMDIST returns the #VALUE! error value.
  • If x ≤ 0 or if standard_dev ≤ 0, LOGNORMDIST returns the #NUM! error value.
  • The equation for the lognormal cumulative distribution function is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
4 | Value at which to evaluate the function (x)
3.5 | Mean of ln(x)
1.2 | Standard deviation of ln(x)
Formula | Description (Result)
=LOGNORMDIST(A2,A3,A4) | Cumulative lognormal distribution at 4 with the terms above (0.039084)


MAX

Returns the largest value in a set of values.

Syntax

MAX(number1,number2, ...)

Number1,number2, ... are 1 to 30 numbers for which you want to find the maximum value.

Remarks

  • You can specify arguments that are numbers, empty cells, logical values, or text representations of numbers. Arguments that are error values or text that cannot be translated into numbers cause errors.
  • If an argument is an array or reference, only numbers in that array or reference are used. Empty cells, logical values, or text in the array or reference are ignored. If logical values and text must not be ignored, use MAXA instead.
  • If the arguments contain no numbers, MAX returns 0 (zero).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
10
7
9
27
2
Formula | Description (Result)
=MAX(A2:A6) | Largest of the numbers above (27)
=MAX(A2:A6, 30) | Largest of the numbers above and 30 (30)


MAXA

Returns the largest value in a list of arguments. Text and logical values such as TRUE and FALSE are compared as well as numbers.

MAXA is similar to MINA. For more information, see the examples for MINA.

Syntax

MAXA(value1,value2, ...)

Value1, Value2, ... are 1 to 30 values for which you want to find the largest value.

Remarks

  • You can specify arguments that are numbers, empty cells, logical values, or text representations of numbers. Arguments that are error values cause errors. If the calculation must not include text or logical values, use MAX instead.
  • If an argument is an array or reference, only values in that array or reference are used. Empty cells and text values in the array or reference are ignored.
  • Arguments that contain TRUE evaluate as 1; arguments that contain text or FALSE evaluate as 0 (zero).
  • If the arguments contain no values, MAXA returns 0 (zero).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
0
0.2
0.5
0.4
TRUE
Formula | Description (Result)
=MAXA(A2:A6) | Largest of the numbers above. TRUE evaluates to 1 (1)


MEDIAN

Returns the median of the given numbers. The median is the number in the middle of a set of numbers; that is, half the numbers have values that are greater than the median, and half have values that are less.

Syntax

MEDIAN(number1,number2, ...)

Number1, number2, ... are 1 to 30 numbers for which you want the median.

Remarks

  • The arguments should be either numbers or names, arrays, or references that contain numbers. All the numbers in each reference or array argument are examined in the spreadsheet.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.

  • If there is an even number of numbers in the set, then MEDIAN calculates the average of the two numbers in the middle. See the second formula following.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
1
2
3
4
5
6
Formula | Description (Result)
=MEDIAN(A2:A6) | Median of the first 5 numbers in the list above (3)
=MEDIAN(A2:A7) | Median of all the numbers above, or the average of 3 and 4 (3.5)


MIN

Returns the smallest number in a set of values.

Syntax

MIN(number1,number2, ...)

Number1, number2, ... are 1 to 30 numbers for which you want to find the minimum value.

Remarks

  • You can specify arguments that are numbers, empty cells, logical values, or text representations of numbers. Arguments that are error values or text that cannot be translated into numbers cause errors.
  • If an argument is an array or reference, only numbers in that array or reference are used. Empty cells, logical values, or text in the array or reference are ignored. If logical values and text should not be ignored, use MINA instead.
  • If the arguments contain no numbers, MIN returns 0.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
10
7
9
27
2
Formula | Description (Result)
=MIN(A2:A6) | Smallest of the numbers above (2)
=MIN(A2:A6,0) | Smallest of the numbers above and 0 (0)


MINA

Returns the smallest value in the list of arguments. Text and logical values such as TRUE and FALSE are compared as well as numbers.

Syntax

MINA(value1,value2,...)

Value1, value2,... are 1 to 30 values for which you want to find the smallest value.

Remarks

  • You can specify arguments that are numbers, empty cells, logical values, or text representations of numbers. Arguments that are error values cause errors. If the calculation must not include text or logical values, use the MIN worksheet function instead.
  • If an argument is an array or reference, only values in that array or reference are used. Empty cells and text values in the array or reference are ignored.
  • Arguments that contain TRUE evaluate as 1; arguments that contain text or FALSE evaluate as 0 (zero).
  • If the arguments contain no values, MINA returns 0.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
FALSE
0.2
0.5
0.4
0.8
Formula | Description (Result)
=MINA(A2:A6) | Smallest of the numbers above. FALSE evaluates to 0 (0)


MODE

Returns the most frequently occurring, or repetitive, value in an array or range of data. Like MEDIAN, MODE is a location measure.

Syntax

MODE(number1,number2, ...)

Number1, number2, ... are 1 to 30 arguments for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments should be numbers, names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If the data set contains no duplicate data points, MODE returns the #N/A error value.

In a set of values, the mode is the most frequently occurring value; the median is the middle value; and the mean is the average value. No single measure of central tendency provides a complete picture of the data. Suppose data is clustered in three areas, half around a single low value, and half around two large values. Both AVERAGE and MEDIAN may return a value in the relatively empty middle, and MODE may return the dominant low value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
5.6
4
4
3
2
4
Formula | Description (Result)
=MODE(A2:A7) | Mode, or most frequently occurring number above (4)


NEGBINOMDIST

Returns the negative binomial distribution. NEGBINOMDIST returns the probability that there will be number_f failures before the number_s-th success, when the constant probability of a success is probability_s. This function is similar to the binomial distribution, except that the number of successes is fixed, and the number of trials is variable. Like the binomial, trials are assumed to be independent.

For example, you need to find 10 people with excellent reflexes, and you know the probability that a candidate has these qualifications is 0.3. NEGBINOMDIST calculates the probability that you will interview a certain number of unqualified candidates before finding all 10 qualified candidates.

Syntax

NEGBINOMDIST(number_f,number_s,probability_s)

Number_f is the number of failures.

Number_s is the threshold number of successes.

Probability_s is the probability of a success.

Remarks

  • Number_f and number_s should be >= 0.
  • Number_f and number_s are truncated to integers.
  • If any argument is nonnumeric, NEGBINOMDIST returns the #VALUE! error value.
  • If probability_s < 0 or if probability > 1, NEGBINOMDIST returns the #NUM! error value.
  • The equation for the negative binomial distribution is:

    where:

    x is number_f, r is number_s, and p is probability_s.

Example

The example may be easier to understand if you copy it to a blank worksheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
10 | Number of failures
5 | Threshold number of successes
0.25 | Probability of a success
Formula | Description (Result)
=NEGBINOMDIST(A2,A3,A4) | Negative binomial distribution for the terms above (0.055049)


NORMDIST

Returns the normal distribution for the specified mean and standard deviation. This function has a very wide range of applications in statistics, including hypothesis testing.

Syntax

NORMDIST(x,mean,standard_dev,cumulative)

X is the value for which you want the distribution.

Mean is the arithmetic mean of the distribution.

Standard_dev is the standard deviation of the distribution.

Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMDIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.

Remarks

  • If mean or standard_dev is nonnumeric, NORMDIST returns the #VALUE! error value.
  • If standard_dev ≤ 0, NORMDIST returns the #NUM! error value.
  • If mean = 0, standard_dev = 1, and cumulative = TRUE, NORMDIST returns the standard normal distribution, NORMSDIST.
  • The equation for the normal density function (cumulative = FALSE) is:

  • When cumulative = TRUE, the formula is the integral from negative infinity to x of the given formula.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
42 | Value for which you want the distribution
40 | Arithmetic mean of the distribution
1.5 | Standard deviation of the distribution
Formula | Description (Result)
=NORMDIST(A2,A3,A4,TRUE) | Cumulative distribution function for the terms above (0.908789)
=NORMDIST(A2,A3,A4,FALSE) | Probability mass function for the terms above (0.10934005)


NORMINV

Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.

Syntax

NORMINV(probability,mean,standard_dev)

Probability is a probability corresponding to the normal distribution.

Mean is the arithmetic mean of the distribution.

Standard_dev is the standard deviation of the distribution.

Remarks

  • If any argument is nonnumeric, NORMINV returns the #VALUE! error value.
  • If probability < 0 or if probability > 1, NORMINV returns the #NUM! error value.
  • If standard_dev ≤ 0, NORMINV returns the #NUM! error value.

  • If mean = 0 and standard_dev = 1, NORMINV uses the standard normal distribution (see NORMSINV).

NORMINV uses an iterative technique for calculating the function. Given a probability value, NORMINV iterates until the result is accurate to within ± 3x10^-7. If NORMINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.908789 | Probability corresponding to the normal distribution
40 | Arithmetic mean of the distribution
1.5 | Standard deviation of the distribution
Formula | Description (Result)
=NORMINV(A2,A3,A4) | Inverse of the normal cumulative distribution for the terms above (42)


NORMSDIST

Returns the standard normal cumulative distribution function. The distribution has a mean of 0 (zero) and a standard deviation of one. Use this function in place of a table of standard normal curve areas.

Syntax

NORMSDIST(z)

Z is the value for which you want the distribution.

Remarks

  • If z is nonnumeric, NORMSDIST returns the #VALUE! error value.
  • The equation for the standard normal density function is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=NORMSDIST(1.333333) | Normal cumulative distribution function at 1.333333 (0.908789)


NORMSINV

Returns the inverse of the standard normal cumulative distribution. The distribution has a mean of zero and a standard deviation of one.

Syntax

NORMSINV(probability)

Probability is a probability corresponding to the normal distribution.

Remarks

  • If probability is nonnumeric, NORMSINV returns the #VALUE! error value.
  • If probability < 0 or if probability > 1, NORMSINV returns the #NUM! error value.

NORMSINV uses an iterative technique for calculating the function. Given a probability value, NORMSINV iterates until the result is accurate to within ± 3x10^-7. If NORMSINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=NORMSINV(0.908789) | Inverse of the standard normal cumulative distribution, with a probability of 0.908789 (1.3333)


PEARSON

Returns the Pearson product moment correlation coefficient, r, a dimensionless index that ranges from -1.0 to 1.0 inclusive and reflects the extent of a linear relationship between two data sets.

Syntax

PEARSON(array1,array2)

Array1 is a set of independent values.

Array2 is a set of dependent values.

Remarks

  • The arguments must be either numbers or names, array constants, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If array1 and array2 are empty or have a different number of data points, PEARSON returns the #N/A error value.
  • The r value of the regression line is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Independent values | Dependent values
9 | 10
7 | 6
5 | 1
3 | 5
1 | 3
Formula | Description (Result)
=PEARSON(A2:A6,B2:B6) | Pearson product moment correlation coefficient for the data sets above (0.699379)


PERCENTILE

Returns the k-th percentile of values in a range. You can use this function to establish a threshold of acceptance. For example, you can decide to examine candidates who score above the 90th percentile.

Syntax

PERCENTILE(array,k)

Array is the array or range of data that defines relative standing.

K is the percentile value in the range 0...1, inclusive.

Remarks

  • If array is empty or contains more than 8,191 data points, PERCENTILE returns the #NUM! error value.
  • If k is nonnumeric, PERCENTILE returns the #VALUE! error value.
  • If k < 0 or if k > 1, PERCENTILE returns the #NUM! error value.
  • If k is not a multiple of 1/(n - 1), PERCENTILE interpolates to determine the value at the k-th percentile.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
1
3
2
4
Formula | Description (Result)
=PERCENTILE(A2:A5,0.3) | 30th percentile of the list above (1.9)


PERCENTRANK

Returns the rank of a value in a data set as a percentage of the data set. This function can be used to evaluate the relative standing of a value within a data set. For example, you can use PERCENTRANK to evaluate the standing of an aptitude test score among all scores for the test.

Syntax

PERCENTRANK(array,x,significance)

Array is the array or range of data with numeric values that defines relative standing.

X is the value for which you want to know the rank.

Significance is an optional value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK uses three digits (0.xxx).

Remarks

  • If array is empty, PERCENTRANK returns the #NUM! error value.
  • If significance < 1, PERCENTRANK returns the #NUM! error value.
  • If x does not match one of the values in array, PERCENTRANK interpolates to return the correct percentage rank.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
13
12
11
8
4
3
2
1
1
1
Formula | Description (Result)
=PERCENTRANK(A2:A11,2) | Percent rank of 2 in the list above (0.333, because 3 values in the set are smaller than 2, and 6 are larger than 2; 3/(3+6)=0.333)
=PERCENTRANK(A2:A11,4) | Percent rank of 4 in the list above (0.555)
=PERCENTRANK(A2:A11,8) | Percent rank of 8 in the list above (0.666)
=PERCENTRANK(A2:A11,5) | Percent rank of 5 in the list above (0.583, one-quarter of the way between the PERCENTRANK of 4 and the PERCENTRANK of 8)

Note To view the number as a percent, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab and then select the Percent format you want in the Number Format box.


PERMUT

Returns the number of permutations for a given number of objects that can be selected from number objects. A permutation is any set or subset of objects or events where internal order is significant. Permutations are different from combinations, for which the internal order is not significant. Use this function for lottery-style probability calculations.

Syntax

PERMUT(number,number_chosen)

Number is an integer that describes the number of objects.

Number_chosen is an integer that describes the number of objects in each permutation.

Remarks

  • Both arguments are truncated to integers.
  • If number or number_chosen is nonnumeric, PERMUT returns the #VALUE! error value.
  • If number ≤ 0 or if number_chosen < 0, PERMUT returns the #NUM! error value.
  • If number < number_chosen, PERMUT returns the #NUM! error value.
  • The equation for the number of permutations is:

Example

Suppose you want to calculate the odds of selecting a winning lottery number. Each lottery number contains three numbers, each of which can be between 0 (zero) and 99, inclusive. The following function calculates the number of possible permutations:

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
100 | Number of objects
3 | Number of objects in each permutation
Formula | Description (Result)
=PERMUT(A2,A3) | Permutations possible for the terms above (970200)


POISSON

Returns the Poisson distribution. A common application of the Poisson distribution is predicting the number of events over a specific time, such as the number of cars arriving at a toll plaza in 1 minute.

Syntax

POISSON(x,mean,cumulative)

X is the number of events.

Mean is the expected numeric value.

Cumulative is a logical value that determines the form of the probability distribution returned. If cumulative is TRUE, POISSON returns the cumulative Poisson probability that the number of random events occurring will be between zero and x inclusive; if FALSE, it returns the Poisson probability mass function that the number of events occurring will be exactly x.

Remarks

  • If x is not an integer, it is truncated.
  • If x or mean is nonnumeric, POISSON returns the #VALUE! error value.
  • If x ≤ 0, POISSON returns the #NUM! error value.
  • If mean ≤ 0, POISSON returns the #NUM! error value.
  • POISSON is calculated as follows.

    For cumulative = FALSE:

    For cumulative = TRUE:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
2 | Number of events
5 | Expected mean
Formula | Description (Result)
=POISSON(A2,A3,TRUE) | Cumulative Poisson probability with the terms above (0.124652)
=POISSON(A2,A3,FALSE) | Poisson probability mass function with the terms above (0.084224)


PROB

Returns the probability that values in a range are between two limits. If upper_limit is not supplied, returns the probability that values in x_range are equal to lower_limit.

Syntax

PROB(x_range,prob_range,lower_limit,upper_limit)

X_range is the range of numeric values of x with which there are associated probabilities.

Prob_range is a set of probabilities associated with values in x_range.

Lower_limit is the lower bound on the value for which you want a probability.

Upper_limit is the optional upper bound on the value for which you want a probability.

Remarks

  • If any value in prob_range ≤ 0 or if any value in prob_range > 1, PROB returns the #NUM! error value.
  • If the sum of the values in prob_range ¹ 1, PROB returns the #NUM! error value.
  • If upper_limit is omitted, PROB returns the probability of being equal to lower_limit.
  • If x_range and prob_range contain a different number of data points, PROB returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
x | Probability
0 | 0.2
1 | 0.3
2 | 0.1
3 | 0.4
Formula | Description (Result)
=PROB(A2:A5,B2:B5,2) | Probability that x is 2 (0.1)
=PROB(A2:A5,B2:B5,1,3) | Probability that x is between 1 and 3 (0.8)


QUARTILE

Returns the quartile of a data set. Quartiles often are used in sales and survey data to divide populations into groups. For example, you can use QUARTILE to find the top 25 percent of incomes in a population.

Syntax

QUARTILE(array,quart)

Array is the array or cell range of numeric values for which you want the quartile value.

Quart indicates which value to return.

If quart equals | QUARTILE returns
0 | Minimum value
1 | First quartile (25th percentile)
2 | Median value (50th percentile)
3 | Third quartile (75th percentile)
4 | Maximum value

Remarks
  • If array is empty, QUARTILE returns the #NUM! error value.
  • If quart is not an integer, it is truncated.
  • If quart < 0 or if quart > 4, QUARTILE returns the #NUM! error value.
  • MIN, MEDIAN, and MAX return the same value as QUARTILE when quart is equal to 0 (zero), 2, and 4, respectively.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
1
2
4
7
8
9
10
12
Formula | Description (Result)
=QUARTILE(A2:A9,1) | First quartile (25th percentile) of the data above (3.5)


RANK

Returns the rank of a number in a list of numbers. The rank of a number is its size relative to other values in a list. (If you were to sort the list, the rank of the number would be its position.)

Syntax

RANK(number,ref,order)

Number is the number whose rank you want to find.

Ref is an array of, or a reference to, a list of numbers. Nonnumeric values in ref are ignored.

Order is a number specifying how to rank number.

  • If order is 0 (zero) or omitted, the number is ranked as if ref were a list sorted in descending order.
  • If order is any nonzero value, the number is ranked as if ref were a list sorted in ascending order.

Remarks

RANK gives duplicate numbers the same rank. However, the presence of duplicate numbers affects the ranks of subsequent numbers. For example, in a list of integers, if the number 10 appears twice and has a rank of 5, then 11 would have a rank of 7 (no number would have a rank of 6).

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
7
3.5
3.5
1
2
Formula | Description (Result)
=RANK(A3,A2:A6,1) | Rank of 3.5 in the list above (3)
=RANK(A2,A2:A6,1) | Rank of 7 in the list above (5)


RSQ

Returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's. For more information, see PEARSON. The r-squared value can be interpreted as the proportion of the variance in y attributable to the variance in x.

Syntax

RSQ(known_y's,known_x's)

Known_y's is an array or range of data points.

Known_x's is an array or range of data points.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If known_y's and known_x's are empty or have a different number of data points, RSQ returns the #N/A error value.
  • The equation for the r value of the regression line is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known y | Known x
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
7 | 4
5 | 4
Formula | Description (Result)
=RSQ(A2:A8,B2:B8) | Square of the Pearson product moment correlation coefficient through data points above (0.05795)


SKEW

Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry of a distribution around its mean. Positive skewness indicates a distribution with an asymmetric tail extending toward more positive values. Negative skewness indicates a distribution with an asymmetric tail extending toward more negative values.

Syntax

SKEW(number1,number2, ...)

Number1,number2... are 1 to 30 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If there are fewer than three data points, or the sample standard deviation is zero, SKEW returns the #DIV/0! error value.
  • The equation for skewness is defined as:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
3
4
5
2
3
4
5
6
4
7
Formula | Description (Result)
=SKEW(A2:A11) | Skewness of a distribution of the data set above (0.359543)


SLOPE

Returns the slope of the linear regression line through data points in known_y's and known_x's. The slope is the vertical distance divided by the horizontal distance between any two points on the line, which is the rate of change along the regression line.

Syntax

SLOPE(known_y's,known_x's)

Known_y's is an array or cell range of numeric dependent data points.

Known_x's is the set of independent data points.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If known_y's and known_x's are empty or have a different number of data points, SLOPE returns the #N/A error value.
  • The equation for the slope of the regression line is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known y | Known x
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
7 | 4
5 | 4
Formula | Description (Result)
=SLOPE(A2:A8,B2:B8) | Slope of the linear regression line through the data points above (0.305556)


SMALL

Returns the k-th smallest value in a data set. Use this function to return values with a particular relative standing in a data set.

Syntax

SMALL(array,k)

Array is an array or range of numerical data for which you want to determine the k-th smallest value.

K is the position (from the smallest) in the array or range of data to return.

Remarks

  • If array is empty, SMALL returns the #NUM! error value.
  • If k ≤ 0 or if k exceeds the number of data points, SMALL returns the #NUM! error value.
  • If n is the number of data points in array, SMALL(array,1) equals the smallest value, and SMALL(array,n) equals the largest value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Data
3 | 1
4 | 4
5 | 8
2 | 3
3 | 7
4 | 12
6 | 54
4 | 8
7 | 23
Formula | Description (Result)
=SMALL(A2:A10,4) | 4th smallest number in first column (4)
=SMALL(B2:B10,2) | 2nd smallest number in the second column (3)


STANDARDIZE

Returns a normalized value from a distribution characterized by mean and standard_dev.

Syntax

STANDARDIZE(x,mean,standard_dev)

X is the value you want to normalize.

Mean is the arithmetic mean of the distribution.

Standard_dev is the standard deviation of the distribution.

Remarks

  • If standard_dev ≤ 0, STANDARDIZE returns the #NUM! error value.
  • The equation for the normalized value is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
42 | Value to normalize
40 | Arithmetic mean of the distribution
1.5 | Standard deviation of the distribution
Formula | Description (Result)
=STANDARDIZE(A2,A3,A4) | Normalized value of 42 for the terms above (1.333333)


STDEV

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).

Syntax

STDEV(number1,number2,...)

Number1,number2,... are 1 to 30 number arguments 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

  • Logical values such as TRUE and FALSE and text are ignored. If logical values and text must not be ignored, use the STDEVA spreadsheet function.
  • 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 "nonbiased" or "n-1" method.
  • STDEV uses the following formula:

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 spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=STDEV(A2:A11) | Standard deviation of breaking strength (27.46391572)


STDEVA

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). Text and logical values such as TRUE and FALSE are included in the calculation.

Syntax

STDEVA(value1,value2, ...)

Value1,value2, ... are 1 to 30 values 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

  • STDEVA assumes that its arguments are a sample of the population. If your data represents the entire population, you must compute the standard deviation using STDEVPA.
  • Arguments that contain TRUE evaluate as 1; arguments that contain text or FALSE evaluate as 0 (zero). If the calculation must not include text or logical values, use the STDEV spreadsheet function instead.
  • The standard deviation is calculated using the "nonbiased" or "n-1" method.
  • STDEVA uses the following formula:

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 spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=STDEVA(A2:A11) | Standard deviation of breaking strength for all the tools (27.46391572)


STDEVP

Calculates standard deviation based on the entire population given as arguments. The standard deviation is a measure of how widely values are dispersed from the average value (the mean).

Syntax

STDEVP(number1,number2, ...)

Number1,number2, ... are 1 to 30 number arguments corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • Logical values such as TRUE and FALSE and text are ignored. If logical values and text must not be ignored, use the STDEVPA spreadsheet function.
  • STDEVP assumes that its arguments are the entire population. If your data represents a sample of the population, then compute the standard deviation using STDEV.
  • For large sample sizes, STDEV and STDEVP return approximately equal values.
  • The standard deviation is calculated using the "biased" or "n" method.
  • STDEVP uses the following formula:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=STDEVP(A2:A11) | Standard deviation of breaking strength, assuming only 10 tools are produced (26.05455814)


STDEVPA

Calculates standard deviation based on the entire population given as arguments, including text and logical values. The standard deviation is a measure of how widely values are dispersed from the average value (the mean).

Syntax

STDEVPA(value1,value2, ...)

Value1,value2,... are 1 to 30 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • STDEVPA assumes that its arguments are the entire population. If your data represents a sample of the population, you must compute the standard deviation using STDEVA.
  • Arguments that contain TRUE evaluate as 1; arguments that contain text or FALSE evaluate as 0 (zero). If the calculation must not include text or logical values, use the STDEVP spreadsheet function instead.
  • For large sample sizes, STDEVA and STDEVPA return approximately equal values.
  • The standard deviation is calculated using the "biased" or "n" method.
  • STDEVPA uses the following formula:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=STDEVPA(A2:A11) | Standard deviation of breaking strength, assuming only 10 tools are produced (26.05455814)


STEYX

Returns the standard error of the predicted y-value for each x in the regression. The standard error is a measure of the amount of error in the prediction of y for an individual x.

Syntax

STEYX(known_y's,known_x's)

Known_y's is an array or range of dependent data points.

Known_x's is an array or range of independent data points.

Remarks

  • The arguments must be either numbers or names, arrays, or references that contain numbers.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If known_y's and known_x's are empty or have a different number of data points, STEYX returns the #N/A error value.
  • The equation for the standard error of the predicted y is:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Known y | Known x
2 | 6
3 | 5
9 | 11
1 | 7
8 | 5
7 | 4
5 | 4
Formula | Description (Result)
=STEYX(A2:A8,B2:B8) | Standard error of the predicted y-value for each x in the regression (3.305719)


TDIST

Returns the Percentage Points (probability) for the Student t-distribution where a numeric value (x) is a calculated value of t for which the Percentage Points are to be computed. The t-distribution is used in the hypothesis testing of small sample data sets. Use this function in place of a table of critical values for the t-distribution.

Syntax

TDIST(x,degrees_freedom,tails)

X is the numeric value at which to evaluate the distribution.

Degrees_freedom is an integer indicating the number of degrees of freedom.

Tails specifies the number of distribution tails to return. If tails = 1, TDIST returns the one-tailed distribution. If tails = 2, TDIST returns the two-tailed distribution.

Remarks

  • If any argument is nonnumeric, TDIST returns the #VALUE! error value.
  • If degrees_freedom < 1, TDIST returns the #NUM! error value.
  • The degrees_freedom and tails arguments are truncated to integers.
  • If tails is any value other than 1 or 2, TDIST returns the #NUM! error value.
  • TDIST is calculated as TDIST = p( x<abs(X)), where X is a random variable that follows the t-distribution.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
1.96 | Value at which to evaluate the distribution
60 | Degrees of freedom
Formula | Description (Result)
=TDIST(A2,A3,2) | Two-tailed distribution (0.054644927 or 5.46 percent)
=TDIST(A2,A3,1) | One-tailed distribution (0.027322463 or 2.73 percent)

Note To view the number as a percent, select the cell and click Commands and Options Button image on the toolbar. Click the Format tab, and then click Percent in the Number Format box.


TINV

Returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom.

Syntax

TINV(probability,degrees_freedom)

Probability is the probability associated with the two-tailed Student's t-distribution.

Degrees_freedom is the number of degrees of freedom to characterize the distribution.

Remarks

  • If either argument is nonnumeric, TINV returns the #VALUE! error value.
  • If probability < 0 or if probability > 1, TINV returns the #NUM! error value.
  • If degrees_freedom is not an integer, it is truncated.
  • If degrees_freedom < 1, TINV returns the #NUM! error value.
  • TINV is calculated as TINV = p( t<X ), where X is a random variable that follows the t-distribution.
  • A one-tailed t-value can be returned by replacing probability with 2*probability. For a probability of 0.05 and degrees of freedom of 10, the two-tailed value is calculated with TINV(0.05,10), which returns 2.28139. The one-tailed value for the same probability and degrees of freedom can be calculated with TINV(2*0.05,10), which returns 1.812462.

    Note In some tables, probability is described as (1-p).

TINV uses an iterative technique for calculating the function. Given a probability value, TINV iterates until the result is accurate to within ± 3x10^-7. If TINV does not converge after 100 iterations, the function returns the #N/A error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
0.054645 | Probability associated with the two-tailed Student's t-distribution
60 | Degrees of freedom
Formula | Description (Result)
=TINV(A2,A3) | t-value of the Student's t-distribution for the terms above (1.959997462)


TREND

Returns values along a linear trend. Fits a straight line (using the method of least squares) to the arrays known_y's and known_x's. Returns the y-values along that line for the array of new_x's that you specify.

Syntax

TREND(known_y's,known_x's,new_x's,const)

Known_y's is the set of y-values you already know in the relationship y = mx + b.

  • If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.

  • If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.

Known_x's is an optional set of x-values that you may already know in the relationship y = mx + b.

  • The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).

  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.

New_x's are new x-values for which you want TREND to return corresponding y-values.

  • New_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.

  • If you omit new_x's, it is assumed to be the same as known_x's.

  • If you omit both known_x's and new_x's, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.

Const is a logical value specifying whether to force the constant b to equal 0.

  • If const is TRUE or omitted, b is calculated normally.

  • If const is FALSE, b is set equal to 0 (zero), and the m-values are adjusted so that y = mx.

Remarks

  • For information about how a line is fit to data, see LINEST.
  • You can use TREND for polynomial curve fitting by regressing against the same variable raised to different powers. For example, suppose column A contains y-values and column B contains x-values. You can enter x^2 in column C, x^3 in column D, and so on, and then regress columns B through D against column A.
  • Formulas that return arrays must be entered as array formulas.
  • When entering an array constant for an argument such as known_x's, use commas to separate values in the same row and semicolons to separate rows.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.

The first formula shows corresponding values to the known values. The second formula predicts the next months values, if the linear trend continues.

Month | Cost | Formula (Corresponding Cost)
1 | $133,890 | =TREND(B2:B13, A2:A13)
2 | $135,000 |
3 | $135,790 |
4 | $137,300 |
5 | $138,130 |
6 | $139,100 |
7 | $139,900 |
8 | $141,120 |
9 | $141,890 |
10 | $143,230 |
11 | $144,000 |
12 | $145,290 |
Month | Formula (Predicted Cost)
13 | =TREND(B2:B13, A2:A13,A15:A19)
14 |
15 |
16 |
17 |

Note The formula in the example must be entered as an array formula. After copying the example to a blank spreadsheet, select the range C2:C13 or B15:B19 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 results are 133953.3333 and 146171.5152.


TRIMMEAN

Returns the mean of the interior of a data set. TRIMMEAN calculates the mean taken by excluding a percentage of data points from the top and bottom tails of a data set. You can use this function when you wish to exclude outlying data from your analysis.

Syntax

TRIMMEAN(array,percent)

Array is the array or range of values to trim and average.

Percent is the fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2), 2 from the top and 2 from the bottom of the set.

Remarks

  • If percent < 0 or percent > 1, TRIMMEAN returns the #NUM! error value.
  • TRIMMEAN rounds the number of excluded data points down to the nearest multiple of 2. If percent = 0.1, 10 percent of 30 data points equals 3 points. For symmetry, TRIMMEAN excludes a single value from the top and bottom of the data set.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
4
5
6
7
2
3
4
5
1
2
3
Formula | Description (Result)
=TRIMMEAN(A2:A12,0.2) | Mean of the interior of a data set above, with 20 percent excluded from calculation (3.777778)


TTEST

Returns the probability associated with a Student's t-Test. Use TTEST to determine whether two samples are likely to have come from the same two underlying populations that have the same mean.

Syntax

TTEST(array1,array2,tails,type)

Array1 is the first data set.

Array2 is the second data set.

Tails specifies the number of distribution tails. If tails = 1, TTEST uses the one-tailed distribution. If tails = 2, TTEST uses the two-tailed distribution.

Type is the kind of t-Test to perform.

If type equals | This test is performed
1 | Paired
2 | Two-sample equal variance (homoscedastic)
3 | Two-sample unequal variance (heteroscedastic)

Remarks

  • If array1 and array2 have a different number of data points, and type = 1 (paired), TTEST returns the #N/A error value.
  • The tails and type arguments are truncated to integers.
  • If tails or type is nonnumeric, TTEST returns the #VALUE! error value.
  • If tails is any value other than 1 or 2, TTEST returns the #NUM! error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data 1 | Data 2
3 | 6
4 | 19
5 | 3
8 | 2
9 | 14
1 | 4
2 | 5
4 | 17
5 | 1
Formula | Description (Result)
=TTEST(A2:A10,B2:B10,2,1) | Probability associated with a Student's paired t-Test, with a two-tailed distribution (0.196016)


VAR

Estimates variance based on a sample.

Syntax

VAR(number1,number2, ...)

Number1,number2, ... are 1 to 30 number arguments corresponding to a sample of a population.

Remarks

  • VAR assumes that its arguments are a sample of the population. If your data represents the entire population, then compute the variance using VARP.
  • Logical values such as TRUE and FALSE and text are ignored. If logical values and text must not be ignored, use the VARA spreadsheet function.
  • VAR uses the following formula:

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 spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=VAR(A2:A11) | Variance for the breaking strength of the tools (754.2666667)


VARA

Estimates variance based on a sample. In addition to numbers, text and logical values such as TRUE and FALSE are included in the calculation.

Syntax

VARA(value1,value2, ...)

Value1,value2, ... are 1 to 30 value arguments corresponding to a sample of a population.

Remarks

  • VARA assumes that its arguments are a sample of the population. If your data represents the entire population, you must compute the variance using VARPA.
  • Arguments that contain TRUE evaluate as 1; arguments that contain text or FALSE evaluate as 0 (zero). If the calculation must not include text or logical values, use the VAR spreadsheet function instead.
  • VARA uses the following formula:

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 spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=VARA(A2:A11) | Estimates the variance for the breaking strength (754.2666667)


VARP

Calculates variance based on the entire population.

Syntax

VARP(number1,number2, ...)

Number1,number2, ... are 1 to 30 number arguments corresponding to a population.

  • Logical values such as TRUE and FALSE and text are ignored. If logical values and text must not be ignored, use the VARPA spreadsheet function.

Remarks

  • VARP assumes that its arguments are the entire population. If your data represents a sample of the population, then compute the variance using VAR.
  • The equation for VARP is:

Example

Suppose all 10 tools stamped from the same machine during a production run are collected and measured for breaking strength.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=VARP(A2:A11) | Variance of breaking strengths for all the tools, assuming that only 10 tools are produced (678.84)


VARPA

Calculates variance based on the entire population. In addition to numbers, text and logical values such as TRUE and FALSE are included in the calculation.

Syntax

VARPA(value1,value2, ...)

Value1,value2,... are 1 to 30 value arguments corresponding to a population.

Remarks

  • VARPA assumes that its arguments are the entire population. If your data represents a sample of the population, you must compute the variance using VARA.
  • Arguments that contain TRUE evaluate as 1; arguments that contain text or FALSE evaluate as 0 (zero). If the calculation must not include text or logical values, use VARP instead.
  • The equation for VARPA is :

Example

Suppose all 10 tools stamped from the same machine during a production run are collected and measured for breaking strength.

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Strength
1345
1301
1368
1322
1310
1370
1318
1350
1303
1299
Formula | Description (Result)
=VARPA(A2:A11) | Variance of breaking strengths for all the tools, assuming that only 10 tools are produced (678.84)


WEIBULL

Returns the Weibull distribution. Use this distribution in reliability analysis, such as calculating a device's mean time to failure.

Syntax

WEIBULL(x,alpha,beta,cumulative)

X is the value at which to evaluate the function.

Alpha is a parameter to the distribution.

Beta is a parameter to the distribution.

Cumulative determines the form of the function.

Remarks

  • If x, alpha, or beta is nonnumeric, WEIBULL returns the #VALUE! error value.
  • If x < 0, WEIBULL returns the #NUM! error value.
  • If alpha ≤ 0 or if beta ≤ 0, WEIBULL returns the #NUM! error value.
  • The equation for the Weibull cumulative distribution function is:

  • The equation for the Weibull probability density function is:

  • When alpha = 1, WEIBULL returns the exponential distribution with:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data | Description
105 | Value at which to evaluate the function
20 | Alpha parameter to the distribution
100 | Beta parameter to the distribution
Formula | Description (Result)
=WEIBULL(A2,A3,A4,TRUE) | Weibull cumulative distribution function for the terms above (0.929581)
=WEIBULL(A2,A3,A4,FALSE) | Weibull probability density function for the terms above (0.035589)


ZTEST

Returns the two-tailed P-value of a z-test. The z-test generates a standard score for x with respect to the data set, array, and returns the two-tailed probability for the normal distribution. You can use this function to assess the likelihood that a particular observation is drawn from a particular population.

Syntax

ZTEST(array,x,sigma)

Array is the array or range of data against which to test x.

X is the value to test.

Sigma is the population (known) standard deviation. If omitted, the sample standard deviation is used.

Remarks

  • If array is empty, ZTEST returns the #N/A error value.
  • ZTEST is calculated as follows:

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
3
6
7
8
6
5
4
2
1
9
Formula | Description (Result)
=ZTEST(A2:A11,4) | Two-tailed P-value of a z-test for the data set above, at the value of 4 (0.090574)


ASC

For double-byte character set (DBCS) languages, changes half-width (single-byte) English characters to full-width (double-byte) characters.

Syntax

ASC(text)

Text is the text or a reference to a cell that contains the text you want to change. If text does not contain any full-width English letters, text is not changed.

Examples

=ASC("EXCEL") equals "EXCEL"

=ASC(" Excel Excel Excel Excel ") equals " Excel Excel Excel Excel "


CHAR

Returns the character specified by a number. Use CHAR to translate code page numbers you might get from files on other types of computers into characters.

Syntax

CHAR(number)

Number is a number between 1 and 255 specifying which character you want. The character is from the character set used by your computer.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=CHAR(65) | Displays the 65 character in the set (A)
=CHAR(33) | Displays the 33 character in the set (!)


CLEAN

Removes all nonprintable characters from text. Use CLEAN on text imported from other applications that contains characters that may not print with your operating system. For example, you can use CLEAN to remove some low-level computer code that is frequently at the beginning and end of data files and cannot be printed.

Syntax

CLEAN(text)

Text is any worksheet information from which you want to remove nonprintable characters.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
=CHAR(7)&"text"&CHAR(7)
Formula | Description (Result)
=CLEAN(A2) | Removes the nonprintable character, CHAR(7), from the string above (text).


CODE

Returns a numeric code for the first character in a text string. The returned code corresponds to the character set used by your computer.

Syntax

CODE(text)

Text is the text for which you want the code of the first character in the text string.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=CODE("A") | Displays the numeric code for A (65)
=CODE("!") | Displays the numeric code for ! (33)


CONCATENATE

Joins several text strings into one text string.

Syntax

CONCATENATE (text1,text2,...)

Text1, text2, ... are 1 to 30 text items to be joined into a single text item. The text items can be text strings, numbers, or single-cell references.

Remarks

The "&" operator can be used instead of CONCATENATE to join text items.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
brook trout
species
32
Formula | Description
=CONCATENATE("Stream population for ",A2," ",A3," is ",A4,"/mile") | Concatenates a sentence from the data above (Stream population for brook trout species is 32/mile)


DOLLAR

Converts a number to text using currency format, with the decimals rounded to the specified place. The format used is $#,##0.00_);($#,##0.00).

Syntax

DOLLAR(number,decimals)

Number is a number, a reference to a cell containing a number, or a formula that evaluates to a number.

Decimals is the number of digits to the right of the decimal point. If decimals is negative, number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.

Remark

The major difference between formatting a cell that contains a number with the Currency format (Format tab, Commands and Options dialog box) and formatting a number directly with the DOLLAR function is that DOLLAR converts its result to text. A number formatted with the Currency format is still a number. You can continue to use numbers formatted with DOLLAR in formulas, because numbers entered as text values are converted to numbers when calculated.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
1234.567
-1234.567
-0.123
99.888
Formula | Description (Result)
=DOLLAR(A2, 2) | Displays the first number in a currency format, 2 digits to the right of the decimal point ($1,234.57)
=DOLLAR(A2, -2) | Displays the first number in a currency format, 2 digits to the left of the decimal point ($1,200)
=DOLLAR(A3, -2) | Displays the second number in a currency format, 2 digits to the left of the decimal point (($1,200))
=DOLLAR(A4, 4) | Displays the third number in a currency format, 4 digits to the right of the decimal point(($0.1230))
=DOLLAR(A5) | Displays the fourth number in a currency format, 2 digit to the left of the decimal point ($99.89)


EXACT

Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise. EXACT is case-sensitive but ignores formatting differences. Use EXACT to test text being entered into a document.

Syntax

EXACT(text1,text2)

Text1 is the first text string.

Text2 is the second text string.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
First string | Second string
word | word
Word | word
w ord | word
Formula | Description (Result)
=EXACT(A2,B2) | Checks whether the strings in the first row match (TRUE)
=EXACT(A3,B3) | Checks whether the strings in the second row match (FALSE)
=EXACT(A4,B4) | Checks whether the strings in the third row match (FALSE)


FIND

Finds one text string (find_text) within another text string (within_text), and returns the number of the starting position of find_text, from the first character of within_text. You can also use SEARCH to find one text string within another, but unlike SEARCH, FIND is case sensitive and doesn't allow wildcard characters.

Syntax

FIND(find_text,within_text,start_num)

Find_text is the text you want to find.

Within_text is the text containing the text you want to find.

Start_num specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.

Show Tip

Use start_num to skip a specified number of characters. For example, suppose you are working with the text string "AYF0093.YoungMensApparel". To find the number of the first "Y" in the descriptive part of the text string, set start_num equal to 8 so that the serial-number portion of the text is not searched. FIND begins with character 8, finds find_text at the next character, and returns the number 9. FIND always returns the number of characters from the start of within_text, counting the characters you skip if start_num is greater than 1.

Remarks

  • If find_text is "" (empty text), FIND matches the first character in the search string (that is, the character numbered start_num or 1).
  • Find_text cannot contain any wildcard characters.
  • If find_text does not appear in within_text, FIND returns the #VALUE! error value.
  • If start_num is not greater than zero, FIND returns the #VALUE! error value.
  • If start_num is greater than the length of within_text, FIND returns the #VALUE! error value.

Example 1

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Miriam McGovern
Formula | Description (Result)
=FIND("M",A2) | Position of the first "M" in the string above (1)
=FIND("m",A2) | Position of the first "m" in the string above (6)
=FIND("M",A2,3) | Position of the first "M" in the string above, starting with the third character (8)

Example 2

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Ceramic Insulators #124-TD45-87
Copper Coils #12-671-6772
Variable Resistors #116010
Formula | Description (Result)
=MID(A2,1,FIND(" #",A2,1)-1) | Extracts text from position 1 to the position of "#" in the first string above (Ceramic Insulators)
=MID(A3,1,FIND(" #",A3,1)-1) | Extracts text from position 1 to the position of "#" in the second string above (Copper Coils)
=MID(A4,1,FIND(" #",A4,1)-1) | Extracts text from position 1 to the position of "#" in the third string above (Variable Resistors)


FIXED

Rounds a number to the specified number of decimals, formats the number in decimal format using a period and commas, and returns the result as text.

Syntax

FIXED(number,decimals,no_commas)

Number is the number you want to round and convert to text.

Decimals is the number of digits to the right of the decimal point.

No_commas is a logical value that, if TRUE, prevents FIXED from including commas in the returned text.

Remarks

  • Numbers in a spreadsheet can never have more than 15 significant digits, but decimals can be as large as 127.
  • If decimals is negative, number is rounded to the left of the decimal point.
  • If you omit decimals, it is assumed to be 2.
  • If no_commas is FALSE or omitted, then the returned text includes commas as usual.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
1234.567
-1234.567
44.332
Formula | Description (Result)
=FIXED(A2, 1) | Rounds the first number 1 digit to the right of the decimal point (1,234.6)
=FIXED(A2, -1) | Rounds the first number 1 digit to the left of the decimal point (1,230)
=FIXED(-1234.567, -1, TRUE) | Rounds the second number 1 digit to the left of the decimal point, without commas (-1230)
=FIXED(44.332) | Rounds the third number 2 digits to the left of the decimal point (44.33)


LEFT

LEFT returns the first character or characters in a text string, based on the number of characters you specify.

Syntax

LEFT(text,num_chars)

Text is the text string that contains the characters you want to extract.

Num_chars specifies the number of characters you want LEFT to extract.

  • Num_chars must be greater than or equal to zero.

  • If num_chars is greater than the length of text, LEFT returns all of text.

  • If num_chars is omitted, it is assumed to be 1.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Sale Price
Sweden
Formula | Description (Result)
=LEFT(A2,4) | First four characters in the first string (Sale)
=LEFT(A3) | First character in the second string (S)


LEN

LEN returns the number of characters in a text string.

Syntax

LEN(text)

Text is the text whose length you want to find. Spaces count as characters.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Phoenix, AZ
One
Formula | Description (Result)
=LEN(A2) | Length of the first string (11)
=LEN(A3) | Length of the second string (0)
=LEN(A4) | Length of the third string, which includes 5 spaces (8)


LOWER

Converts all uppercase letters in a text string to lowercase.

Syntax

LOWER(text)

Text is the text you want to convert to lowercase. LOWER does not change characters in text that are not letters.

Example

The example may be easier to understand if you copy it to a blank worksheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
E. E. Cummings
Apt. 2B
Formula | Description (Result)
=LOWER(A2) | Lower case of first string (e. e. cummings)
=LOWER(A3) | Lower case of last string (apt. 2b)


MID

MID returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.

Syntax

MID(text,start_num,num_chars)

Text is the text string containing the characters you want to extract.

Start_num is the position of the first character you want to extract in text. The first character in text has start_num 1, and so on.

Num_chars specifies the number of characters you want MID to return from text.

Remarks

  • If start_num is greater than the length of text, MID returns "" (empty text).
  • If start_num is less than the length of text, but start_num plus num_chars exceeds the length of text, MID returns the characters up to the end of text.
  • If start_num is less than 1, MID returns the #VALUE! error value.

  • If num_chars is negative, MID returns the #VALUE! error value.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Fluid Flow
Formula | Description (Result)
=MID(A2,1,5) | Five characters from the string above, starting at the first character (Fluid)
=MID(A2,7,20) | Twenty characters from the string above, starting at the seventh (Flow)
=MID(A2,20,5) | Because the starting point is greater than the length of the string, empty text is returned ()


PROPER

Capitalizes the first letter in a text string and any other letters in the text string that follow any character other than a letter. Converts all other letters to lowercase letters.

Syntax

PROPER(text)

Text is text enclosed in quotation marks, a formula that returns text, or a reference to a cell containing the text you want to partially capitalize.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
this is a TITLE
2-cent's worth
76BudGet
Formula | Description (Result)
=PROPER(A2) | Proper case of first string (This Is A Title)
=PROPER(A3) | Proper case of second string (2-Cent'S Worth)
=PROPER(A4) | Proper case of third string (76Budget)


REPLACE

REPLACE replaces part of a text string, based on the number of characters you specify, with a different text string.

Syntax

REPLACE(old_text,start_num,num_chars,new_text)

Old_text is text in which you want to replace some characters.

Start_num is the position of the character in old_text that you want to replace with new_text.

Num_chars is the number of characters in old_text that you want REPLACE to replace with new_text.

New_text is the text that will replace characters in old_text.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
abcdefghijk
2009
123456
Formula | Description (Result)
=REPLACE(A2,6,5,"*") | Replaces five characters, starting with the sixth character (abcde*k)
=REPLACE(A3,3,2,"10") | Replaces the last two digits of 2009 with 10 (2010)
=REPLACE(A4,1,3,"@") | Replaces the first three characters with @ (@456)


REPT

Repeats text a given number of times. Use REPT to fill a cell with a number of instances of a text string.

Syntax

REPT(text,number_times)

Text is the text you want to repeat.

Number_times is a positive number specifying the number of times to repeat text.

Remarks

  • If number_times is 0 (zero), REPT returns "" (empty text).

  • If number_times is not an integer, it is truncated.

  • The result of the REPT function cannot be longer than 32,767 characters, or REPT returns #VALUE!.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=REPT("*-", 3) | Displays the string 3 times (*-*-*-)
=REPT("-",10) | Displays a dash 10 times (----------)


RIGHT

RIGHT returns the last characters in a text string, based on the number of characters you specify.

Syntax

RIGHT(text,num_chars)

Text is the text string containing the characters you want to extract.

Num_chars specifies the number of characters you want RIGHT to extract.

Remarks

  • Num_chars must be greater than or equal to zero.
  • If num_chars is greater than the length of text, RIGHT returns all of text.
  • If num_chars is omitted, it is assumed to be 1.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Sale Price
Stock Number
Formula | Description (Result)
=RIGHT(A2,5) | Last 5 characters of the first string (Price)
=RIGHT(A3) | Last character of the second string (r)


SEARCH

SEARCH returns the number of the character at which a specific character or text string is first found, beginning with start_num. Use SEARCH to determine the location of a character or text string within another text string so that you can use the MID or REPLACE functions to change the text.

Syntax

SEARCH(find_text,within_text,start_num)

Find_text is the text you want to find. You can use the wildcard characters— question mark (?) and asterisk (*) in find_text. 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 (~) before the character.

Within_text is the text in which you want to search for find_text.

Start_num is the character number in within_text at which you want to start searching.

Show Tip

Use start_num to skip a specified number of characters. For example, suppose you are working with the text string "AYF0093.YoungMensApparel". To find the number of the first "Y" in the descriptive part of the text string, set start_num equal to 8 so that the serial-number portion of the text is not searched. SEARCH begins with character 8, finds find_text at the next character, and returns the number 9. SEARCH always returns the number of characters from the start of within_text, counting the characters you skip if start_num is greater than 1.

Remarks

  • SEARCH does not distinguish between uppercase and lowercase letters when searching text.
  • SEARCH is similar to FIND except that FIND is case sensitive.
  • If find_text is not found, the #VALUE! error value is returned.
  • If start_num is omitted, it is assumed to be 1.
  • If start_num is not greater than 0 (zero) or is greater than the length of within_text, the #VALUE! error value is returned.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Statements
Profit Margin
margin
Formula | Description (Result)
=SEARCH("e",A2,6) | Position of the first "e" in the first string above, starting at the sixth position (7)
=SEARCH(A4,A3) | Position of "margin" in "Profit Margin" (8)
=REPLACE(A3,SEARCH(A4,A3),6,"Amount") | Replaces "Margin" with "Amount" (Profit Amount)


SUBSTITUTE

Substitutes new_text for old_text in a text string. Use SUBSTITUTE when you want to replace specific text in a text string; use REPLACE when you want to replace any text that occurs in a specific location in a text string.

Syntax

SUBSTITUTE(text,old_text,new_text,instance_num)

Text is the text or the reference to a cell containing text for which you want to substitute characters.

Old_text is the text you want to replace.

New_text is the text you want to replace old_text with.

Instance_num specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Sales Data
Quarter 1, 2008
Quarter 1, 2011
Formula | Description (Result)
=SUBSTITUTE(A2, "Sales", "Cost") | Substitutes Cost for Sales (Cost Data)
=SUBSTITUTE(A3, "1", "2", 1) | Substitutes first instance of "1" with "2" (Quarter 2, 2008)
=SUBSTITUTE(A4, "1", "2", 3) | Substitutes third instance of "1" with "2" (Quarter 1, 2012)


T

Returns the text referred to by value.

Syntax

T(value)

Value is the value you want to test.

Remarks

  • If value is or refers to text, T returns value. If value does not refer to text, T returns "" (empty text).

  • You do not generally need to use the T function in a formula because values are generally converted as necessary. This function is provided for compatibility with other spreadsheet programs.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
Rainfall
19
TRUE
Formula | Description (Result)
=T(A2) | Because the first value is text, the text is returned (Rainfall)
=T(A3) | Because the second value is a number, empty text is returned ()
=T(A4) | Because the third value is a logical value, empty text is returned ()


TEXT

Converts a value to text in a specific number format.

Syntax

TEXT(value,format_text)

Value is a numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.

Format_text is a number format in text format from the Number Format box on the Format tab in the Commands and Options dialog box.

Remarks

  • Formatting a cell with an option on the Format tab (Commands and Options dialog box) changes only the format, not the value. Using the TEXT function converts a value to formatted text, and the result is no longer calculated as a number.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Salesperson | Sales
Buchanan | 2800
Dodsworth | .4
Formula | Description (Result)
=A2&" sold "&TEXT(B2, "Currency")&" worth of units." | Combines contents above into a phrase (Buchanan sold $2,800.00 worth of units.)
=A3&" sold "&TEXT(B3,"Percent")&" of the total sales." | Combines contents above into a phrase (Dodsworth sold 40.00% of the total sales.)


TRIM

Removes all spaces from text except for single spaces between words. Use TRIM on text that you have received from another application that may have irregular spacing.

Syntax

TRIM(text)

Text is the text from which you want spaces removed.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=TRIM(" First Quarter Earnings ") | Removes leading and trailing spaces from the text in the formula (First Quarter Earnings)


UPPER

Converts text to uppercase.

Syntax

UPPER(text)

Text is the text you want converted to uppercase. Text can be a reference or text string.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Data
total
Yield
Formula | Description (Result)
=UPPER(A2) | Upper case of first string (TOTAL)
=UPPER(A3) | Upper case of second string (YIELD)


VALUE

Converts a text string that represents a number to a number.

Syntax

VALUE(text)

Text is the text enclosed in quotation marks or a reference to a cell containing the text you want to convert.

Remarks

  • Text can be in any of the constant number, date, or time formats recognized by the spreadsheet. If text is not in one of these formats, VALUE returns the #VALUE! error value.

  • You do not generally need to use the VALUE function in a formula because text is automatically converted to numbers as necessary. This function is provided for compatibility with other spreadsheet programs.

Example

The example may be easier to understand if you copy it to a blank spreadsheet.

Show How?

  1. Create a blank spreadsheet.
  2. Select the example in the Help topic.

    Selecting example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the spreadsheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result)
=VALUE("$1,000") | Number equivalent of the string (1000)
=VALUE("16:48:00")-VALUE("12:00:00") | The serial number equivalent to 4 hours and 48 minutes, which is "16:48:00"-"12:00:00" (0.2 or 4:48)


Use the Analysis ToolPak function add-in

The Spreadsheet component supports an additional set of functions that provide the same functionality as the functions in the Analysis ToolPak add-in in Microsoft Excel. To use the Analysis ToolPak functions, you must add two tags to the Web page that contains the Spreadsheet component to connect the Analysis ToolPak add-in.

  1. Open the Web page file that contains a Spreadsheet component in a text editor or Web page editor.
  2. Add the following tags:
    <OBJECT id=atp
   classid="CLSID:3F98D457-551B-48C5-BDE8-7FDECCD5AFA5">
</OBJECT>

<SCRIPT language="VBScript">
   Spreadsheet1.AddIn(atp)
</SCRIPT>
    Where Spreadsheet1 is the value of the ID attribute for the OBJECT tag for the Spreadsheet component on the page.
  3. Save these changes to the Web page.

Once you make these changes, you can use the Analysis ToolPak functions in formulas in your Spreadsheet component. For example, the following formula that uses the ISEVEN function to test whether a numeric value is an even number will return FALSE:

=ISEVEN(7)

Notes

  • You can also instantiate the Analysis ToolPak function add-in and add formulas entirely from script as shown in the following example.
       Dim Spreadsheet1
   Dim atp

   ' Instantiate a Spreadsheet component object.
   Set Spreadsheet1 = CreateObject("OWC11.Spreadsheet")

   ' Instantiate the Analysis ToolPak function add-in.
   Set atp = CreateObject("OWCATP.OWCATP")

   ' Call the AddIn method to connect the add-in to the
   ' spreadsheet.
   Spreadsheet1.AddIn(atp)

   ' Add a formula to cell A1.
   Spreadsheet1.Range("A1").Formula = "=ISEVEN(7)"
  • Using the XMLData or XMLUrl methods in script to load new values into the spreadsheet will disconnect the Analysis ToolPak function add-in. To address this, call the AddIn method again to reconnect the add-in, and then call the CalculateFull method to recalculate the formulas in the spreadsheet.
       ' Assign new XmlData to the spreadsheet.
   Spreadsheet1.XmlData ="XMLDataString"

   ' Reconnect the function add-in
   Spreadsheet1.AddIn(atp)

   ' Recalculate all formulas in the spreadsheet.
   Spreadsheet1.CalculateFull

    Where XMLDataString is a string of XML data in the XML Spreadsheet format, such as the output from saving as XML Spreadsheet (.xml) from Microsoft Office Excel 2003.


Analysis ToolPak functions

The Spreadsheet component supports the Analysis ToolPak functions listed in the table below. Before you can use these functions you must connect the Analysis ToolPak function add-in. For more information, see Use the Analysis ToolPak function add-in. For information on the syntax and use of the functions listed below, search Help in Microsoft Excel or search Microsoft Office Online.

Function | Description
ACCRINT | Returns the accrued interest for a security that pays periodic interest.
ACCRINTM | Returns the accrued interest for a security that pays interest at maturity.
AMORDEGRC | Returns the depreciation for each accounting period. This function is provided for the French accounting system. If an asset is purchased in the middle of the accounting period, the prorated depreciation is taken into account. The function is similar to AMORLINC, except that a depreciation coefficient is applied in the calculation depending on the life of the assets.
AMORLINC | Returns the depreciation for each accounting period. This function is provided for the French accounting system. If an asset is purchased in the middle of the accounting period, the prorated depreciation is taken into account.
BESSELI | Returns the modified Bessel function, which is equivalent to the Bessel function evaluated for purely imaginary arguments.
BESSELJ | Returns the Bessel function.
BESSELK | Returns the modified Bessel function, which is equivalent to the Bessel functions evaluated for purely imaginary arguments.
BESSELY | Returns the Bessel function, which is also called the Weber function or the Neumann function.
BIN2DEC | Converts a binary number to decimal.
BIN2HEX | Converts a binary number to hexadecimal.
BIN2OCT | Converts a binary number to octal.
COMPLEX | Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.
CONVERT | Converts a number from one measurement system to another. For example, CONVERT can translate a table of distances in miles to a table of distances in kilometers.
COUPDAYBS | Returns the number of days from the beginning of the coupon period to the settlement date.
COUPDAYS | Returns the number of days in the coupon period that contains the settlement date.
COUPDAYSNC | Returns the number of days from the settlement date to the next coupon date.
COUPNCD | Returns a number that represents the next coupon date after the settlement date.
COUPNUM | Returns the number of coupons payable between the settlement date and maturity date, rounded up to the nearest whole coupon.
COUPPCD | Returns a number that represents the previous coupon date before the settlement date.
CUMIPMT | Returns the cumulative interest paid on a loan between start_period and end_period.
CUMPRINC | Returns the cumulative principal paid on a loan between start_period and end_period.
DEC2BIN | Converts a decimal number to binary.
DEC2HEX | Converts a decimal number to hexadecimal.
DEC2OCT | Converts a decimal number to octal.
DELTA | Tests whether two values are equal.
DISC | Returns the discount rate for a security.
DOLLARDE | Converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number. Use DOLLARDE to convert fractional dollar numbers, such as securities prices, to decimal numbers.
DOLLARFR | Converts a dollar price expressed as a decimal number into a dollar price expressed as a fraction. Use DOLLARFR to convert decimal numbers to fractional dollar numbers, such as securities prices.
DURATION | Returns the Macauley duration for an assumed par value of $100. Duration is defined as the weighted average of the present value of the cash flows and is used as a measure of a bond price's response to changes in yield.
EDATE | Returns the serial number that represents the date that is the indicated number of months before or after a specified date (the start_date). Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue.
EFFECT | Returns the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year.
EOMONTH | Returns the serial number for the last day of the month that is the indicated number of months before or after start_date. Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month.
ERF | Returns the error function integrated between lower_limit and upper_limit.
ERFC | Returns the complementary ERF function integrated between x and infinity.
FACTDOUBLE | Returns the double factorial of a number.
FVSCHEDULE | Returns the future value of an initial principal after applying a series of compound interest rates. Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
GCD | Returns the greatest common divisor of two or more integers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.
GESTEP | Returns 1 if number ≥ step; returns 0 (zero) otherwise. Use this function to filter a set of values. For example, by summing several GESTEP functions you calculate the count of values that exceed a threshold.
HEX2BIN | Converts a hexadecimal number to binary.
HEX2DEC | Converts a hexadecimal number to decimal.
HEX2OCT | Converts a hexadecimal number to octal.
IMABS | Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.
IMAGINARY | Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
IMARGUMENT | Returns the argument Theta (theta), an angle expressed in radians.
IMCONJUGATE | Returns the complex conjugate of a complex number in x + yi or x + yj text format.
IMCOS | Returns the cosine of a complex number in x + yi or x + yj text format.
IMDIV | Returns the quotient of two complex numbers in x + yi or x + yj text format.
IMEXP | Returns the exponential of a complex number in x + yi or x + yj text format.
IMLN | Returns the natural logarithm of a complex number in x + yi or x + yj text format.
IMLOG10 | Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.
IMLOG2 | Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.
IMPOWER | Returns a complex number in x + yi or x + yj text format raised to a power.
IMPRODUCT | Returns the product of 2 to 29 complex numbers in x + yi or x + yj text format.
IMREAL | Returns the real coefficient of a complex number in x + yi or x + yj text format.
IMSIN | Returns the sine of a complex number in x + yi or x + yj text format.
IMSQRT | Returns the square root of a complex number in x + yi or x + yj text format.
IMSUB | Returns the difference of two complex numbers in x + yi or x + yj text format.
IMSUM | Returns the sum of two or more complex numbers in x + yi or x + yj text format.
INTRATE | Returns the interest rate for a fully invested security.
ISEVEN | Returns TRUE if number is even, or FALSE if number is odd.
ISODD | Returns TRUE if number is odd, or FALSE if number is even.
LCM | Returns the least common multiple of integers. The least common multiple is the smallest positive integer that is a multiple of all integer arguments number1, number2, and so on. Use LCM to add fractions with different denominators.
MDURATION | Returns the modified Macauley duration for a security with an assumed par value of $100.
MROUND | Returns a number rounded to the desired multiple.
MULTINOMIAL | Returns the ratio of the factorial of a sum of values to the product of factorials.
NETWORKDAYS | Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.
NOMINAL | Returns the nominal annual interest rate, given the effective rate and the number of compounding periods per year.
OCT2BIN | Converts an octal number to binary.
OCT2DEC | Converts an octal number to decimal.
OCT2HEX | Converts an octal number to hexadecimal.
ODDFPRICE | Returns the price per $100 face value of a security having an odd (short or long) first period.
ODDFYIELD | Returns the yield of a security that has an odd (short or long) first period.
ODDLPRICE | Returns the price per $100 face value of a security having an odd (short or long) last coupon period.
ODDLYIELD | Returns the yield of a security that has an odd (short or long) last period.
PRICE | Returns the price per $100 face value of a security that pays periodic interest.
PRICEDISC | Returns the price per $100 face value of a discounted security.
PRICEMAT | Returns the price per $100 face value of a security that pays interest at maturity.
QUOTIENT | Returns the integer portion of a division. Use this function when you want to discard the remainder of a division.
RANDBETWEEN | Returns a random number between the numbers you specify. A new random number is returned every time the worksheet is calculated.
RECEIVED | Returns the amount received at maturity for a fully invested security.
SERIESSUM | Returns the sum of a power series.
SQRTPI | Returns the square root of (number * pi).
TBILLEQ | Returns the bond-equivalent yield for a Treasury bill.
TBILLPRICE | Returns the price per $100 face value for a Treasury bill.
TBILLYIELD | Returns the yield for a Treasury bill.
WEEKNUM | Returns a number that indicates where the week falls numerically within a year.
WORKDAY | Returns a number that represents a date that is the indicated number of working days before or after a date (the starting date). Working days exclude weekends and any dates identified as holidays. Use WORKDAY to exclude weekends or holidays when you calculate invoice due dates, expected delivery times, or the number of days of work performed.
XIRR | Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic. To calculate the internal rate of return for a series of periodic cash flows, use the IRR function.
XNPV | Returns the net present value for a schedule of cash flows that is not necessarily periodic. To calculate the net present value for a series of cash flows that is periodic, use the NPV function.
YEARFRAC | Calculates the fraction of the year represented by the number of whole days between two dates (the start_date and the end_date). Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits or obligations to assign to a specific term.
YIELD | Returns the yield on a security that pays periodic interest. Use YIELD to calculate bond yield.
YIELDDISC | Returns the annual yield for a discounted security.
YIELDMAT | Returns the annual yield of a security that pays interest at maturity.