LikeOffice    Excel Consulting

Utility for Excel:

- Compare worksheets
- Database analysis
- Stock to your Excel
- Password recovery
- and many more...
 

 


This page presents how to work with Microsoft Excel 2007 features and its redesigned interface. You may also visit our Excel Question page.

   A bibliography of financial, statistical, and engineering methods

   Statistical functions

   AVEDEV function

   AVERAGE function

   AVERAGEA function

   AVERAGEIF function

   AVERAGEIFS function

   BETADIST function

   BETAINV function

   BINOMDIST function

   CHIDIST function

   CHIINV function

   CHITEST function

   CONFIDENCE function

   CORREL function

   COUNT function

   COUNTA function

   COUNTBLANK function

   COUNTIF function

   COUNTIFS function

   COVAR function

   CRITBINOM function

   DEVSQ function

   EXPONDIST function

   FDIST function

   FINV function

   FISHER function

   FISHERINV function

   FORECAST function

   FREQUENCY function

   FTEST function

   GAMMADIST function

   GAMMAINV function

   GAMMALN function

   GEOMEAN function

   GROWTH function

   HARMEAN function

   HYPGEOMDIST function

   INTERCEPT function

   KURT function

   LARGE function

   LINEST function

   LOGINV function

   LOGNORMDIST function

   MAX function

   MAXA function

   MEDIAN function

   MIN function

   MINA function

   MODE function



A bibliography of financial, statistical, and engineering methods

The following books provide detailed information on financial, statistical, and engineering methods.

Abramowitz, Milton, and Irene A. Stegun. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. 10th ed. New York, NY: Dover Publications, 1974.

Antkies, Candace Mary. Standard Securities Calculation Methods: Fixed Income Securities Formulas for Price, Yield and Accrued Interest: Volume 1. New York, NY: Securities Industry Association.

Antkies, Candace Mary. Standard Securities Calculation Methods, Fixed Income Securities Formulas for Analytic Measures: Volume 2. New York, NY: Securities Industry Association.

Devore, Jay L. Probability and Statistics for Engineering and the Sciences. 5th ed. Pacific Grove, CA: Duxbury Press, 1998.

Fabozzi, Frank J. The Handbook of Fixed-Income Securities. 6th ed. New York, NY: Mcgraw-Hill Trade, 2000.

Hewlett-Packard, HP-12C Solutions Handbook. Palo Alto, CA: Hewlett-Packard, 2001.

McCall, Robert B. Fundamental Statistics for the Behavioral Sciences. 7th ed. Pacific Grove, CA: Brooks Cole, 1998.

Monks, Joseph G. Operations Management: Theory and Problems. 3rd ed. New York, NY: Macmillan/McGraw-Hill, 1988.

Press, W. H., B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling. Numerical Recipes in C: The Art of Scientific Computing. 2nd ed. New York, NY: Cambridge University Press, 1993.

Sokal, Robert R., and F. James Rohlf. Biometry: The Principles and Practice of Statistics in Biological Research. 3rd ed. New York, NY: W. H. Freeman, 1994.

Stigum, Marcia, and John Mann. Money Market Calculations: Yields, Break-Evens, & Arbitrage. 2nd ed. Homewood, IL: Irwin Professional, 1991.


See Also




Excel > Function reference > Statistical

Statistical functions

Click one of the links in the following list to see detailed help about the function.

Function

Description

AVEDEV

Returns the average of the absolute deviations of data points from their mean

AVERAGE

Returns the average of its arguments

AVERAGEA

Returns the average of its arguments, including numbers, text, and logical values

AVERAGEIF

Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria

AVERAGEIFS

Returns the average (arithmetic mean) of all cells that meet multiple criteria.

BETADIST

Returns the beta cumulative distribution function

BETAINV

Returns the inverse of the cumulative distribution function for a specified beta distribution

BINOMDIST

Returns the individual term binomial distribution probability

CHIDIST

Returns the one-tailed probability of the chi-squared distribution

CHIINV

Returns the inverse of the one-tailed probability of the chi-squared distribution

CHITEST

Returns the test for independence

CONFIDENCE

Returns the confidence interval for a population mean

CORREL

Returns the correlation coefficient between two data sets

COUNT

Counts how many numbers are in the list of arguments

COUNTA

Counts how many values are in the list of arguments

COUNTBLANK

Counts the number of blank cells within a range

COUNTIF

Counts the number of cells within a range that meet the given criteria

COUNTIFS

Counts the number of cells within a range that meet multiple criteria

COVAR

Returns covariance, the average of the products of paired deviations

CRITBINOM

Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value

DEVSQ

Returns the sum of squares of deviations

EXPONDIST

Returns the exponential distribution

FDIST

Returns the F probability distribution

FINV

Returns the inverse of the F probability distribution

FISHER

Returns the Fisher transformation

FISHERINV

Returns the inverse of the Fisher transformation

FORECAST

Returns a value along a linear trend

FREQUENCY

Returns a frequency distribution as a vertical array

FTEST

Returns the result of an F-test

GAMMADIST

Returns the gamma distribution

GAMMAINV

Returns the inverse of the gamma cumulative distribution

GAMMALN

Returns the natural logarithm of the gamma function, ֳ(x)

GEOMEAN

Returns the geometric mean

GROWTH

Returns values along an exponential trend

HARMEAN

Returns the harmonic mean

HYPGEOMDIST

Returns the hypergeometric distribution

INTERCEPT

Returns the intercept of the linear regression line

KURT

Returns the kurtosis of a data set

LARGE

Returns the k-th largest value in a data set

LINEST

Returns the parameters of a linear trend

LOGEST

Returns the parameters of an exponential trend

LOGINV

Returns the inverse of the lognormal distribution

LOGNORMDIST

Returns the cumulative lognormal distribution

MAX

Returns the maximum value in a list of arguments

MAXA

Returns the maximum value in a list of arguments, including numbers, text, and logical values

MEDIAN

Returns the median of the given numbers

MIN

Returns the minimum value in a list of arguments

MINA

Returns the smallest value in a list of arguments, including numbers, text, and logical values

MODE

Returns the most common value in a data set

NEGBINOMDIST

Returns the negative binomial distribution

NORMDIST

Returns the normal cumulative distribution

NORMINV

Returns the inverse of the normal cumulative distribution

NORMSDIST

Returns the standard normal cumulative distribution

NORMSINV

Returns the inverse of the standard normal cumulative distribution

PEARSON

Returns the Pearson product moment correlation coefficient

PERCENTILE

Returns the k-th percentile of values in a range

PERCENTRANK

Returns the percentage rank of a value in a data set

PERMUT

Returns the number of permutations for a given number of objects

POISSON

Returns the Poisson distribution

PROB

Returns the probability that values in a range are between two limits

QUARTILE

Returns the quartile of a data set

RANK

Returns the rank of a number in a list of numbers

RSQ

Returns the square of the Pearson product moment correlation coefficient

SKEW

Returns the skewness of a distribution

SLOPE

Returns the slope of the linear regression line

SMALL

Returns the k-th smallest value in a data set

STANDARDIZE

Returns a normalized value

STDEV

Estimates standard deviation based on a sample

STDEVA

Estimates standard deviation based on a sample, including numbers, text, and logical values

STDEVP

Calculates standard deviation based on the entire population

STDEVPA

Calculates standard deviation based on the entire population, including numbers, text, and logical values

STEYX

Returns the standard error of the predicted y-value for each x in the regression

TDIST

Returns the Student's t-distribution

TINV

Returns the inverse of the Student's t-distribution

TREND

Returns values along a linear trend

TRIMMEAN

Returns the mean of the interior of a data set

TTEST

Returns the probability associated with a Student's t-test

VAR

Estimates variance based on a sample

VARA

Estimates variance based on a sample, including numbers, text, and logical values

VARP

Calculates variance based on the entire population

VARPA

Calculates variance based on the entire population, including numbers, text, and logical values

WEIBULL

Returns the Weibull distribution

ZTEST

Returns the one-tailed probability-value of a z-test


See Also




Excel > Function reference > Statistical

AVEDEV function

Excel 2007

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 255 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

  • AVEDEV is influenced by the unit of measurement in the input data.
  • Arguments must either be numbers or be names, arrays, or references that contain numbers.
  • Logical values and text representations of numbers that you type directly into the list of arguments are counted.
  • If an 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:

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

8

A


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)


See Also




Excel > Function reference > Statistical

AVERAGE function

Excel 2007

This article describes the formula syntax and usage of the AVERAGE function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Office Excel.

Description

Returns the average (arithmetic mean) of the arguments. For example, if the range (range: Two or more cells on a sheet. The cells in a range can be adjacent or nonadjacent.) A1:A20 contains numbers, the formula =AVERAGE(A1:A20) returns the average of those numbers.

Syntax

AVERAGE(number1, [number2],...)

The AVERAGE function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

Remarks

  • Arguments can either be numbers or names, ranges, or cell references that contain numbers.
  • Logical values and text representations of numbers that you type directly into the list of arguments are counted.
  • If a range or cell reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • Arguments that are error values or text that cannot be translated into numbers cause errors.
  • If you want to include logical values and text representations of numbers in a reference as part of the calculation, use the AVERAGEA function.
  • If you want to calculate the average of only the values that meet certain criteria, use the AVERAGEIF function or the AVERAGEIFS function.

 Note    The AVERAGE function measures central tendency, which is the location of the center of a group of numbers in a statistical distribution. The three most common measures of central tendency are:

  • Average, which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
  • Median, which is the middle number of a group of numbers; that is, half the numbers have values that are greater than the median, and half the numbers have values that are less than the median. For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
  • Mode, which is the most frequently occurring number in a group of numbers. For example, the mode of 2, 3, 3, 5, 7, and 10 is 3.

For a symmetrical distribution of a group of numbers, these three measures of central tendency are all the same. For a skewed distribution of a group of numbers, they can be different.

Tip  When you average cells, keep in mind the difference between empty cells and those containing the value zero, especially if you have cleared the Show a zero in cells that have a zero value check box in the Excel Options dialog box. When this option is selected, empty cells are not counted, but zero values are.

To locate the Show a zero in cells that have a zero value check box:

  • Click the Microsoft Office Button , click Excel Options, and then, in the Advanced category, look under Display options for this worksheet.

Example

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 

1

2

3

4

5

6

7


8


9


10

A

B

C

Data



10

15

32

7



9



27



2



Formula

Description

Result

=AVERAGE(A2:A6)

Average of the numbers in cells A2 through A6.

11

=AVERAGE(A2:A6, 5)

Average of the numbers in cells A2 through A6 and the number 5.

10

=AVERAGE(A2:C2)

Average of the numbers in cells A2 through C2.

19

Related Office Online discussions

Read related questions and answers from other Microsoft Office customers.


See Also




Excel > Function reference > Statistical

AVERAGEA function

Excel 2007

Calculates the average (arithmetic mean) of the values in the list of arguments.

Syntax

AVERAGEA(value1,value2,...)

Value1, value2, ...   are 1 to 255 cells, ranges of cells, or values for which you want the average.

Remarks

  • Arguments can be the following: numbers; names, arrays, or references that contain numbers; text representations of numbers; or logical values, such as TRUE and FALSE, in a reference.
  • Logical values and text representations of numbers that you type directly into the list of arguments are counted.
  • Arguments that contain TRUE evaluate as 1; arguments that contain FALSE evaluate as 0 (zero).
  • Array or reference arguments that contain text evaluate as 0 (zero). Empty text ("") evaluates as 0 (zero).
  • 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 are error values or text that cannot be translated into numbers cause errors.
  • If you do not want to include logical values and text representations of numbers in a reference as part of the calculation, use the AVERAGE function.

 Note    The AVERAGEA function measures central tendency, which is the location of the center of a group of numbers in a statistical distribution. The three most common measures of central tendency are:

  • Average   which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
  • Median   which is the middle number of a group of numbers; that is, half the numbers have values that are greater than the median, and half the numbers have values that are less than the median. For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
  • Mode   which is the most frequently occurring number in a group of numbers. For example, the mode of 2, 3, 3, 5, 7, and 10 is 3.

For a symmetrical distribution of a group of numbers, these three measures of central tendency are all the same. For a skewed distribution of a group of numbers, they can be different.

Tip  When averaging cells, keep in mind the difference between empty cells and those containing the value zero, especially if you have cleared the Show a zero in cells that have a zero value check box in the Working with Office Applications section of the Advanced category on the Excel Options dialog box under the File menu. Empty cells are not counted but zero values are.

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

A


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)


See Also




Excel > Function reference > Statistical

AVERAGEIF function

Excel 2007

Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria.

Syntax

AVERAGEIF(range,criteria,average_range)

Range  is one or more cells to average, including numbers or names, arrays, or references that contain numbers.

Criteria  is the criteria in the form of a number, expression, cell reference, or text that defines which cells are averaged. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.

Average_range  is the actual set of cells to average. If omitted, range is used.

Remarks

  • Cells in range that contain TRUE or FALSE are ignored.
  • If a cell in average_range is an empty cell, AVERAGEIF ignores it.
  • If range is a blank or text value, AVERAGEIF returns the #DIV0! error value.
  • If a cell in criteria is empty, AVERAGEIF treats it as a 0 value.
  • If no cells in the range meet the criteria, AVERAGEIF returns the #DIV/0! error value.
  • You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. 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.
  • Average_range does not have to be the same size and shape as range. The actual cells that are averaged are determined by using the top, left cell in average_range as the beginning cell, and then including cells that correspond in size and shape to range. For example:

If range is

And average_range is

Then the actual cells evaluated are

A1:A5

B1:B5

B1:B5

A1:A5

B1:B3

B1:B5

A1:B4

C1:D4

C1:D4

A1:B4

C1:C2

C1:D4

 Note    The AVERAGEIF function measures central tendency, which is the location of the center of a group of numbers in a statistical distribution. The three most common measures of central tendency are:

  • Average   which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
  • Median   which is the middle number of a group of numbers; that is, half the numbers have values that are greater than the median, and half the numbers have values that are less than the median. For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
  • Mode   which is the most frequently occurring number in a group of numbers. For example, the mode of 2, 3, 3, 5, 7, and 10 is 3.

For a symmetrical distribution of a group of numbers, these three measures of central tendency are all the same. For a skewed distribution of a group of numbers, they can be different.

Example: Averaging property values and commissions

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

8

9

A

B

Property Value

Commission

100,000

7,000

200,000

14,000

300,000

21,000

400,000

28,000

Formula

Description (result)

=AVERAGEIF(B2:B5,"<23000")

Average of all commissions less than 23,000 (14,000)

=AVERAGEIF(A2:A5,"<95000")

Average of all property values less than 95,000 (#DIV/0!)

=AVERAGEIF(A2:A5,">250000",B2:B5)

Average of all commissions with a property value greater than 250,000 (24,500)

Example: Averaging profits from regional offices

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

8

9

A

B

Region

Profits (Thousands)

East

45,678

West

23,789

North

-4,789

South (New Office)

0

MidWest

9,678

Formula

Description (result)

=AVERAGEIF(A2:A6,"=*West",B2:B6)

Average of all profits for the West and MidWest regions (16,733.5)

=AVERAGEIF(A2:A6,"<>*(New Office)",B2:B6)

Average of all profits for all regions excluding new offices (18,589)


See Also




Excel > Function reference > Statistical

AVERAGEIFS function

Excel 2007

Returns the average (arithmetic mean) of all cells that meet multiple criteria.

Syntax

AVERAGEIFS(average_range,criteria_range1,criteria1,criteria_range2,criteria2…)

Average_range   is one or more cells to average, including numbers or names, arrays, or references that contain numbers.

Criteria_range1, criteria_range2, …   are 1 to 127 ranges in which to evaluate the associated criteria.

Criteria1, criteria2, …   are 1 to 127 criteria in the form of a number, expression, cell reference, or text that define which cells will be averaged. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.

Remarks

  • If average_range is a blank or text value, AVERAGEIFS returns the #DIV0! error value.
  • If a cell in a criteria range is empty, AVERAGEIFS treats it as a 0 value.
  • Cells in range that contain TRUE evaluate as 1; cells in range that contain FALSE evaluate as 0 (zero).
  • Each cell in average_range is used in the average calculation only if all of the corresponding criteria specified are true for that cell.
  • Unlike the range and criteria arguments in the AVERAGEIF function, in AVERAGEIFS each criteria_range must be the same size and shape as sum_range.
  • If cells in average_range cannot be translated into numbers, AVERAGEIFS returns the #DIV0! error value.
  • If there are no cells that meet all the criteria, AVERAGEIFS returns the #DIV/0! error value.
  • You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. 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.

 Note    The AVERAGEIFS function measures central tendency, which is the location of the center of a group of numbers in a statistical distribution. The three most common measures of central tendency are:

  • Average   which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
  • Median   which is the middle number of a group of numbers; that is, half the numbers have values that are greater than the median, and half the numbers have values that are less than the median. For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
  • Mode   which is the most frequently occurring number in a group of numbers. For example, the mode of 2, 3, 3, 5, 7, and 10 is 3.

For a symmetrical distribution of a group of numbers, these three measures of central tendency are all the same. For a skewed distribution of a group of numbers, they can be different.

Example: Averaging student grades

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7



8


9

A

B

C

D

Student

First Quiz Grade

Second Quiz Grade

Final Exam Grade

Emilio

75

85

87

Julie

94

80

88

Hans

86

93

Incomplete

Frederique

Incomplete

75

75

Formula

Description (result)

=AVERAGEIFS(B2:B5,B2:B5,">70",B2:B5,"<90")

Average first quiz grade that falls between 70 and 90 for all students (80.5). The score marked "Incomplete" is not included in the calculation because it is not a numerical value.

=AVERAGEIFS(C2:C5,C2:C5,">95")

Average second quiz grade that is greater than 95 for all students. Because there are no scores greater than 95, #DIV0! is returned.

=AVERAGEIFS(D2:D5,D2:D5,"<>Incomplete",D2:D5,">80")

Average final exam grade that is greater than 80 for all students (87.5). The score marked "Incomplete" is not included in the calculation because it is not a numerical value.

Example: Averaging real estate prices

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

8

9

10

A

B

C

D

E

Type

Price

Town

Number of Bedrooms

Garage?

Cozy Rambler

230000

Issaquah

3

No

Snug Bungalow

197000

Bellevue

2

Yes

Cool Cape Codder

345678

Bellevue

4

Yes

Splendid Split Level

321900

Issaquah

2

Yes

Exclusive Tudor

450000

Bellevue

5

Yes

Classy Colonial

395000

Bellevue

4

No

Formula

Description (result)

=AVERAGEIFS(B2:B7,C2:C7,"Bellevue",D2:D7,">2" ,E2:E7,"Yes")

Average price of a home in Bellevue that has at least 3 bedrooms and a garage (397839)

=AVERAGEIFS(B2:B7,C2:C7,"Issaquah",D2:D7,"<=3" ,E2:E7,"No")

Average price of a home in Issaquah that has up to 3 bedrooms and no garage (230000)


See Also




Excel > Function reference > Statistical

BETADIST function

Excel 2007

Returns the cumulative beta probability density function. The beta distribution 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 of the distribution.

Beta   is a parameter of 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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

A

B

Data

Description

2

Value at which to evaluate the function

8

Parameter of the distribution

10

Parameter of 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)


See Also




Excel > Function reference > Statistical

BETAINV function

Excel 2007

Returns the inverse of the cumulative beta probability density function for a specified beta distribution. That is, if probability = BETADIST(x,...), then BETAINV(probability,...) = x. The 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 of the distribution.

Beta   is a parameter 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.

Given a value for probability, BETAINV seeks that value x such that BETADIST(x, alpha, beta, A, B) = probability. Thus, precision of BETAINV depends on precision of BETADIST. BETAINV uses an iterative search technique. If the search has not converged 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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

A

B

Data

Description

0.685470581

Probability associated with the beta distribution

8

Parameter of the distribution

10

Parameter of 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)


See Also




Excel > Function reference > Statistical

BINOMDIST function

Excel 2007

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 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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

A

B

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)


See Also




Excel > Function reference > Statistical

CHIDIST function

Excel 2007

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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

A

B

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)


See Also




Excel > Function reference > Statistical

CHIINV function

Excel 2007

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 in order 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.

Given a value for probability, CHIINV seeks that value x such that CHIDIST(x, degrees_freedom) = probability. Thus, precision of CHIINV depends on precision of CHIDIST. CHIINV uses an iterative search technique. If the search has not converged 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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

A

B

Data

Description

0.050001

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.3069735)


See Also




Excel > Function reference > Statistical

CHITEST function

Excel 2007

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 using the formula:

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

  • A low value of ק2 is an indicator of independence. As can be seen from the formula, ק2 is always positive or 0, and is 0 only if Aij = Eij for every i,j.
  • CHITEST returns the probability that a value of the ק2 statistic at least as high as the value calculated by the above formula could have happened by chance under the assumption of independence. In computing this probability, CHITEST uses the ק2 distribution with an appropriate number of degrees of freedom, df. If r > 1 and c > 1, then df = (r - 1)(c - 1). If r = 1 and c > 1, then df = c - 1 or if r > 1 and c = 1, then df = r - 1. r = c= 1 is not allowed and #N/A is returned.
  • Use of CHITEST is most appropriate when Eijs are not too small. Some statisticians suggest that each Eij should be greater than or equal to 5.

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

8

A

B

C

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)



See Also




Excel > Function reference > Statistical

CONFIDENCE function

Excel 2007

Returns a value that you can use to construct a confidence interval for a population mean. The confidence interval is a range of values. Your sample mean, x, is at the center of this range and the range is x ± CONFIDENCE. For example, if x is the sample mean of delivery times for products ordered through the mail, x ± CONFIDENCE is a range of population means. For any population mean, ל0, in this range, the probability of obtaining a sample mean further from ל0 than x is greater than alpha; for any population mean, ל0, not in this range, the probability of obtaining a sample mean further from ל0 than x is less than alpha. In other words, assume that we use x, standard_dev, and size to construct a two-tailed test at significance level alpha of the hypothesis that the population mean is ל0. Then we will not reject that hypothesis if ל0 is in the confidence interval and will reject that hypothesis if ל0 is not in the confidence interval. The confidence interval does not allow us to infer that there is probability 1 alpha that our next package will take a delivery time that is in the confidence interval.

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. With alpha = .05, CONFIDENCE(.05, 2.5, 50) returns 0.692952. The corresponding confidence interval is then 30 ± 0.692952 = approximately [29.3, 30.7]. For any population mean, ל0, in this interval, the probability of obtaining a sample mean further from ל0 than 30 is more than 0.05. Likewise, for any population mean, ל0, outside this interval, the probability of obtaining a sample mean further from ל0 than 30 is less than 0.05.

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

A

B

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 confidence interval for the underlying population mean for travel to work equals 30 ± 0.692952 minutes, or 29.3 to 30.7 minutes. (0.692952)


See Also




Excel > Function reference > Statistical

CORREL function

Excel 2007

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

  • 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 x and y are the sample means AVERAGE(array1) and AVERAGE(array2).

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

A

B

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)


See Also




Excel > Function reference > Statistical

COUNT function

Excel 2007

This article describes the formula syntax and usage of the COUNT function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Office Excel.

Description

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

=COUNT(A1:A20)

In this example, if five of the cells in the range contain numbers, the result is 5.

Syntax

COUNT(value1, [value2],...)

The COUNT function syntax has these arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

  • value1  Required. The first item, cell reference, or range within which you want to count numbers.
  • value2, ...  Optional. Up to 255 additional items, cell references, or ranges within which you want to count numbers.

 Note    The arguments can contain or refer to a variety of different types of data, but only numbers are counted.

Remarks

  • Arguments that are numbers, dates, or a text representation of numbers (for example, a number enclosed in quotation marks, such as "1") are counted.
  • Logical values and text representations of numbers that you type directly into the list of arguments are counted.
  • Arguments that are error values or text that cannot be translated into numbers are not counted.
  • If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are not counted.
  • If you want to count logical values, text, or error values, use the COUNTA function.
  • If you want to count only numbers that meet certain criteria, use the COUNTIF function or the COUNTIFS function.

Example

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 

1

2

3

4

5

6

7

8

9


10


11


12

A

B

C

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 cells A2 through A8.

3

=COUNT(A5:A8)

Counts the number of cells that contain numbers in cells A5 through A8.

2

=COUNT(A2:A8,2)

Counts the number of cells that contain numbers in cells A2 through A8, and the value 2

4


See Also




Excel > Function reference > Statistical

COUNTA function

Excel 2007

This article describes the formula syntax and usage of the COUNTA function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Office Excel.

Description

The COUNTA function counts the number of cells that are not empty in a range (range: Two or more cells on a sheet. The cells in a range can be adjacent or nonadjacent.).

Syntax

COUNTA(value1, [value2], ...)

The COUNTA function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

  • value1  Required. The first argument representing the values that you want to count.
  • value2, ...  Optional. Additional arguments representing the values that you want to count, up to a maximum of 255 arguments.

Remarks

  • The COUNTA function counts cells containing any type of information, including error values and empty text (""). For example, if the range contains a formula that returns an empty string, the COUNTA function counts that value. The COUNTA function does not count empty cells.
  • If you do not need to count logical values, text, or error values (in other words, if you want to count only cells that contain numbers), use the COUNT function.
  • If you want to count only cells that meet certain criteria, use the COUNTIF function or the COUNTIFS function.

Example

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 

1

2

3

4

5

6

7

8

9


10

A

B

C

Data



Sales



12/8/2008



 



19



22.24



TRUE



#DIV/0!



Formula

Description

Result

=COUNTA(A2:A8)

Counts the number of nonblank cells in cells A2 through A8.

6


See Also




Excel > Function reference > Statistical

COUNTBLANK function

Excel 2007

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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

A

B

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 empty text. (4)


See Also




Excel > Function reference > Statistical

COUNTIF function

Excel 2007

This article describes the formula syntax and usage of the COUNTIF function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Office Excel.

Description

The COUNTIF function counts the number of cells within a range that meet a single criterion that you specify. For example, you can count all the cells that start with a certain letter, or you can count all the cells that contain a number that is larger or smaller than a number you specify. For example, suppose you have a worksheet that contains a list of tasks in column A, and the first name of the person assigned to each task in column B. You can use the COUNTIF function to count how many times a person's name appears in column B and, in that way, determine how many tasks are assigned to that person. For example:

=COUNTIF(B2:B25,"Nancy")

 Note    To count cells based on multiple criteria, see COUNTIFS function.

Syntax

COUNTIF(range, criteria)

The COUNTIF function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

  • range  Required. One or more cells to count, including numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.
  • criteria  Required. A number, expression, cell reference, or text string that defines which cells will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32".

 Notes 

    • You can use the wildcard characters  the question mark (?) and the asterisk (* in criteria. A question mark matches any single character, and an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
    • Criteria are case insensitive; for example, the string "apples" and the string "APPLES" will match the same cells.

Example 1: Common COUNTIF formulas

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 

1

2

3

4

5

6


7


8


9



10


11




12

A

B

C

Data

Data


apples

32


oranges

54


peaches

75


apples

86


Formula

Description

Result

=COUNTIF(A2:A5,"apples")

Number of cells with apples in cells A2 through A5.

2

=COUNTIF(A2:A5,A4)

Number of cells with peaches in cells A2 through A5.

1

=COUNTIF(A2:A5,A3)+COUNTIF(A2:A5,A2)

Number of cells with oranges and apples in cells A2 through A5.

3

=COUNTIF(B2:B5,">55")

Number of cells with a value greater than 55 in cells B2 through B5.

2

=COUNTIF(B2:B5,"<>"&B4)

Number of cells with a value not equal to 75 in cells B2 through B5.

3

=COUNTIF(B2:B5,">=32")-COUNTIF(B2:B5,">85")

Number of cells with a value greater than or equal to 32 and less than or equal to 85 in cells B2 through B5.

3

Example 2: COUNTIF formulas using wildcard characters and handling blank values

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 

1

2

3

4

5

6

7

8




9






10




11



12





13





14

A

B

C

Data

Data


apples

Yes


 

 


oranges

NO


peaches

No


 

 


apples

yes


Formula

Description

Result

=COUNTIF(A2:A7,"*es")

Number of cells ending with the letters "es" in cells A2 through A7.

4

=COUNTIF(A2:A7,"?????es")

Number of cells ending with the letters "les" and having exactly 7 letters in cells A2 through A7.

2

=COUNTIF(A2:A7,"*")

Number of cells containing any text in cells A2 through A7.

4

=COUNTIF(A2:A7,"<>"&"*")

Number of cells not containing text in cells A2 through A7.

2

=COUNTIF(B2:B7,"No") / ROWS(B2:B7)

The average number of No votes (including blank cells) in cells B2 through B7.

0.333333333

=COUNTIF(B2:B7,"Yes") / (ROWS(B2:B7) -COUNTIF(B2:B7, "<>"&"*"))

The average number of Yes votes (excluding blank cells) in cells B2 through B7.

0.5

 Note     To view a number as a percentage, select the cell and then, on the Sheet tab, in the Number group, click Percentage Style .

Related Office Online discussions

Read related questions and answers from other Microsoft Office customers.


See Also




Excel > Function reference > Statistical

COUNTIFS function

Excel 2007

This article describes the formula syntax and usage of the COUNTIFSfunction (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Office Excel.

Description

Applies criteria to cells across multiple ranges and counts the number of times all criteria are met.

Syntax

COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)

The COUNTIFS function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

  • criteria_range1  Required. The first range in which to evaluate the associated criteria.
  • criteria1  Required. The criteria in the form of a number, expression, cell reference, or text that define which cells will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32".
  • criteria_range2, criteria2, ...  Optional. Additional ranges and their associated criteria. Up to 127 range/criteria pairs are allowed.

Important  Each additional range must have the same number of rows and columns as the criteria_range1 argument. The ranges do not have to be adjacent to each other.

Remarks

  • Each range's criteria is applied one cell at a time. If all of the first cells meet their associated criteria, the count increases by 1. If all of the second cells meet their associated criteria, the count increases by 1 again, and so on until all of the cells are evaluated.
  • If the criteria argument is a reference to an empty cell, the COUNTIFS function treats the empty cell as a 0 value.
  • You can use the wildcard characters the question mark (?) and asterisk (*)  in criteria. A question mark matches any single character, and an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

Example 1

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 



1

2

3

4

5

6




7



8




9

A

B

C

D

Sales Person

Exceeded Widgets Quota

Exceeded Gadgets Quota

Exceeded Doodads Quota

Davidoski

Yes

No

No

Burke

Yes

Yes

No

Sundaram

Yes

Yes

Yes

Levitan

No

Yes

Yes

Formula

Description

Result

=COUNTIFS(B2:D2,"=Yes")

Counts how many times Davidoski exceeded a sales quota for Widgets, Gadgets, and Doodads.

1

=COUNTIFS(B2:B5,"=Yes",C2:C5,"=Yes")

Counts how many sales people exceeded both their Widgets and Gadgets Quota.

2

=COUNTIFS(B5:D5,"=Yes",B3:D3,"=Yes")

Counts how many times Levitan and Burke exceeded the same quota for Widgets, Gadgets, and Doodads.

1

Example 2

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

How do I copy an example?

  1. Select the example in this article.

Important  Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In Excel, create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V.

Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

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

 

1

2

3

4

5

6

7

8



9





10



11

A

B

C

Data

Data


1

5/1/2008


2

5/2/2008


3

5/3/2008


4

5/4/2008


5

5/5/2008


6

5/6/2008


Formula

Description

Result

=COUNTIFS(A2:A7,"<6",A2:A7,">1")

Counts how many numbers between 1 and 6 (not including 1 and 6) are contained in cells A2 through A7.

4

=COUNTIFS(A2:A7, "<5",B2:B7,"<5/3/2008")

Counts how many rows have numbers that are less than 5 in cells A2 through A7, and also have dates that are are earlier than 5/3/2008 in cells B2 through B7.

2

=COUNTIFS(A2:A7, "<" & A6,B2:B7,"<" & B4)

Same description as the previous example, but using cell references instead of constants in the criteria.

2


See Also




Excel > Function reference > Statistical

COVAR function

Excel 2007

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 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 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:

where x and y are the sample means AVERAGE(array1) and AVERAGE(array2), and n is the sample size.

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

A

B

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)


See Also




Excel > Function reference > Statistical

CRITBINOM function

Excel 2007

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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

A

B

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)


See Also




Excel > Function reference > Statistical

DEVSQ function

Excel 2007

Returns the sum of squares of deviations of data points from their sample mean.

Syntax

DEVSQ(number1,number2,...)

Number1, number2, ...   are 1 to 255 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

  • Arguments can either be numbers or names, arrays, or references that contain numbers.
  • Logical values and text representations of numbers that you type directly into the list of arguments are counted.
  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • Arguments that are error values or text that cannot be translated into numbers cause errors.
  • The equation for the sum of squared deviations is:

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

5

6

7

8

A


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)


See Also




Excel > Function reference > Statistical

EXPONDIST function

Excel 2007

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 worksheet.

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

A

B

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)


See Also




Excel > Function reference > Statistical

FDIST function

Excel 2007

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 the test scores of 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 with degrees_freedom1 and degrees_freedom2 degrees of freedom.

Example

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

How to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

 Note    Do not select the row or column headers.

Selecting an example from Help

  1. Press CTRL+C.
  2. In the worksheet, select cell A1, and press CTRL+V.
  3. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

 

1

2

3

4

A

B

Data

Description

15.20686486

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)


See Also




Excel > Function reference > Statistical

FINV function

Excel 2007

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 income diversity.

Syntax

FINV(