Excel formula library

Excel Tutorial

Every Excel formula in one place — search, filter by category or level, then open syntax, samples, and pitfalls. New formulas added to the library appear here automatically.

127 Formulas
11 Categories
3 Skill levels
Live Search & filters

Formula list

Find any Excel formula

Filter by category — Math, Lookup, FILTER and other Dynamic Arrays, Text, Date, and more — then open a formula for syntax and examples.

Chapter 2

Statistical Analysis

  1. 13 AVERAGE =AVERAGE(number1, [number2], ...) Calculates the arithmetic mean of a range of numbers. Divides the sum of numeric values by the count of numbers present. Statistical Analysis Beginner Classic

    Syntax

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

    Arguments

    number1
    First number, cell reference, or continuous range.
    [number2, ...]
    Additional numbers or ranges (up to 255 arguments).

    Sample

    =AVERAGE(C2:C5)

    Result 362.5

    Sample data

    Download
    ABCD
    2E-101HR350Good
    3E-102IT400Very Good
    4E-103Sales450Excellent
    5E-104Marketing250Average
    Pro tip

    Cells containing 0 ARE counted in the average, while truly blank empty cells are safely excluded.

    Common pitfall

    If a cell accidentally contains a literal "0", AVERAGE includes it and lowers the mean drastically.

  2. 14 AVERAGEA =AVERAGEA(value1, [value2], ...) Calculates the average of values in a list. Text and FALSE evaluate as 0; TRUE evaluates as 1. Empty cells in ranges are ignored. Statistical Analysis Intermediate Classic

    Syntax

    =AVERAGEA(value1, [value2], ...)

    Arguments

    value1
    First argument or range containing mixed types.

    Sample

    =AVERAGEA(C2:C5)

    Result 290

    Sample data

    Download
    ABCD
    2RohanMath400Passed
    3KabirMath360Passed
    4MeenaMathAbsentCounted as 0 in AVERAGEA
    5PriyaMath400Passed
    Pro tip

    If your dataset contains text strings like "N/A" or "Absent", AVERAGE ignores them, but AVERAGEA penalizes them as 0.

    Common pitfall

    Using AVERAGEA unintentionally on text column descriptions will severely deflate your computed average.

  3. 15 MIN =MIN(number1, [number2], ...) Finds the smallest numeric value across cells. Empty cells, text strings, and boolean values in ranges are ignored. Statistical Analysis Beginner Classic

    Syntax

    =MIN(number1, [number2], ...)

    Arguments

    number1, [number2, ...]
    1 to 255 numbers, ranges, or cell references to find minimum.

    Sample

    =MIN(C2:C5)

    Result 250

    Sample data

    Download
    ABCD
    2E-101HR350Standard
    3E-102IT400Standard
    4E-103Sales450Top
    5E-104Logistics250Minimum
    Pro tip

    To find the minimum value that meets specific criteria, use MINIFS (available in Excel 2019+ and Office 365).

    Common pitfall

    If the referenced range contains only text strings, MIN returns 0.

  4. 16 MAX =MAX(number1, [number2], ...) Returns the maximum numeric figure in a range or argument array. Ignores empty cells and text strings. Statistical Analysis Beginner Classic

    Syntax

    =MAX(number1, [number2], ...)

    Arguments

    number1, [number2, ...]
    Up to 255 numeric arguments or ranges to scan for maximum.

    Sample

    =MAX(C2:C5)

    Result 450

    Sample data

    Download
    ABCD
    2E-101HR350Regular
    3E-102IT400Regular
    4E-103Sales450Highest Value
    5E-104Marketing250Regular
    Pro tip

    Combine with MATCH and INDEX to pull the employee name associated with maximum sales: =INDEX(A2:A5, MATCH(MAX(C2:C5), C2:C5, 0)).

    Common pitfall

    MAX ignores numbers stored as text strings (e.g. "'500" will not be recognized as 500).

  5. 17 COUNT =COUNT(value1, [value2], ...) Counts cells containing numbers and dates. Text cells, booleans, and blank spaces are ignored. Statistical Analysis Beginner Classic

    Syntax

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

    Arguments

    value1, [value2, ...]
    Values, cell references, or ranges to count numeric values.

    Sample

    =COUNT(C2:C5)

    Result 4

    Sample data

    Download
    ABCD
    21Rohan Sharma88Numeric
    32Kabir Verma92Numeric
    43Meena Gupta75Numeric
    54Priya Singh85Numeric
    Pro tip

    Dates and times in Excel are internally stored as serial numbers, so COUNT recognizes dates as valid numbers.

    Common pitfall

    Numbers stored formatted as text with leading apostrophes will NOT be counted by COUNT.

  6. 18 COUNTA =COUNTA(value1, [value2], ...) Counts all non-empty cells in a range. Counts numbers, text strings, formulas returning empty strings, and booleans. Statistical Analysis Beginner Classic

    Syntax

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

    Arguments

    value1, [value2, ...]
    Cells or ranges to check for any present content.

    Sample

    =COUNTA(B2:B5)

    Result 4

    Sample data

    Download
    ABCD
    21Rohan SharmaDelhi98111...
    32Kabir VermaMumbai98222...
    43Meena GuptaPune98333...
    54Priya SinghBangalore98444...
    Pro tip

    Cells with formulas returning empty string "" are treated as non-empty by COUNTA.

    Common pitfall

    A cell containing an invisible whitespace character " " is counted as non-empty by COUNTA.

  7. 19 COUNTBLANK =COUNTBLANK(range) Counts blank cells in a range. Also counts cells with formulas that return an empty text string "". Statistical Analysis Beginner Classic

    Syntax

    =COUNTBLANK(range)

    Arguments

    range
    The range from which you want to count blank cells.

    Sample

    =COUNTBLANK(C2:C5)

    Result 2

    Sample data

    Download
    ABCD
    2101Rohan Sharma9876543210Complete
    3102Kabir VermaMissing (Blank)
    4103Meena Gupta9812345678Complete
    5104Priya SinghMissing (Blank)
    Pro tip

    COUNTBLANK counts formula cells evaluating to "" as blank, making it ideal for checking unfulfilled lookups.

    Common pitfall

    A cell containing a space (" ") looks blank to the human eye, but COUNTBLANK will NOT count it as blank.

  8. 20 COUNTIF =COUNTIF(range, criteria) Counts cells within a range matching a single condition. Supports comparison operators (>, Statistical Analysis Intermediate Classic

    Syntax

    =COUNTIF(range, criteria)

    Arguments

    range
    The continuous range of cells to count from.
    criteria
    The condition that must be met to increment the count.

    Sample

    =COUNTIF(B2:B5, "HR")

    Result 2

    Sample data

    Download
    ABCD
    2E-101HR350Match 1
    3E-102IT400No match
    4E-103HR450Match 2
    5E-104Sales250No match
    Pro tip

    COUNTIF is case-insensitive: "hr", "HR", and "Hr" will all match equally.

    Common pitfall

    When using comparison operators with numbers, enclose the operator in quotes: COUNTIF(C2:C5, ">300").

  9. 21 COUNTIFS =COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...) Applies criteria to cells across multiple ranges and counts the number of times all criteria are met. Statistical Analysis Intermediate Classic

    Syntax

    =COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)

    Arguments

    criteria_range1
    First range in which to evaluate the associated criteria.
    criteria1
    Condition 1 defining which cells are counted.
    [criteria_range2, criteria2]
    Additional ranges and corresponding conditions (up to 127 pairs).

    Sample

    =COUNTIFS(B2:B5, "HR", D2:D5, "01-Jan")

    Result 1

    Sample data

    Download
    ABCD
    2E-101HR35001-Jan
    3E-102IT40001-Jan
    4E-103Sales45002-Jan
    5E-104HR30002-Jan
    Pro tip

    Up to 127 range/criteria pairs can be chained in a single COUNTIFS statement.

    Common pitfall

    Every criteria range must have identical dimensions; otherwise a #VALUE! error occurs.

  10. 22 SUBTOTAL =SUBTOTAL(function_num, ref1, [ref2], ...) Returns a subtotal in a list or database. Can compute SUM, AVERAGE, COUNT, MAX, MIN, and standard deviation while excluding rows hidden by AutoFilter. Statistical Analysis Intermediate Classic

    Syntax

    =SUBTOTAL(function_num, ref1, [ref2], ...)

    Arguments

    function_num
    Number 1-11 (includes manually hidden rows) or 101-111 (ignores manually hidden rows). 9 or 109 = SUM.
    ref1, [ref2, ...]
    One or more ranges to subtotal.

    Sample

    =SUBTOTAL(9, C2:C5)

    Result 1450

    Sample data

    Download
    ABCD
    2E-101HR350Visible
    3E-102IT400Visible
    4E-103Sales450Visible
    5E-104Operations250Visible
    Pro tip

    Use function_num 109 to ignore rows hidden manually by right-clicking "Hide"; function_num 9 respects AutoFilter only.

    Common pitfall

    SUBTOTAL automatically ignores any other nested SUBTOTAL formulas inside its range, avoiding double-counting.

  11. 23 LARGE =LARGE(array, k) Returns the k-th largest value in a dataset. Selects values based on their relative standing, such as 1st, 2nd, or 3rd place in rankings. Statistical Analysis Intermediate Classic

    Syntax

    =LARGE(array, k)

    Arguments

    array
    The array or range of data for which you want to determine the k-th largest value.
    k
    The position (from the largest) in the array or cell range of data to return.

    Sample

    =LARGE(C2:C5, 2)

    Result 400

    Sample data

    Download
    ABCD
    2101Rohan Sharma350400
    3102Kabir Verma400? Match (k=2)
    4103Meena Gupta450Top 1 (k=1)
    5104Priya Singh250Lowest
    Pro tip

    To sum the top 3 items in one formula: =SUM(LARGE(C2:C100, {1,2,3})).

    Common pitfall

    If k is greater than the total count of numbers in array, LARGE returns a #NUM! error.

  12. 24 SMALL =SMALL(array, k) Returns the k-th smallest value in a dataset. Useful for extracting lowest bids, runner-up costs, or earliest response times. Statistical Analysis Intermediate Classic

    Syntax

    =SMALL(array, k)

    Arguments

    array
    An array or range of numerical data.
    k
    The position (from the smallest) to return.

    Sample

    =SMALL(C2:C5, 1)

    Result 250

    Sample data

    Download
    ABCD
    2101Rohan Sharma350250
    3102Kabir Verma400Middle
    4103Meena Gupta450Highest
    5104Priya Singh250? Match (k=1)
    Pro tip

    Useful in legacy Excel for building dynamic ascending sorting formulas before the modern SORT function.

    Common pitfall

    Empty cells in the array are ignored; if the array contains no numbers, #NUM! is returned.

  13. 25 RANK =RANK(number, ref, [order]) Returns the rank of a number within a list. Order 0 or omitted ranks descending (highest = 1); order 1 ranks ascending (lowest = 1). Statistical Analysis Intermediate Classic

    Syntax

    =RANK(number, ref, [order])

    Arguments

    number
    The number whose rank you want to find.
    ref
    An array of, or a reference to, a list of numbers.
    [order]
    0 or omitted for descending rank (largest is 1), non-zero for ascending.

    Sample

    =RANK(C2, $C$2:$C$5, 0)

    Result 3

    Sample data

    Download
    ABCD
    2101Rohan Sharma3503
    3102Kabir Verma4002
    4103Meena Gupta4501 (Top)
    5104Priya Singh2504
    Pro tip

    Always lock the reference range with absolute dollar signs ($C$2:$C$5) so dragging down does not shift the comparison list.

    Common pitfall

    Duplicate numbers receive the exact same rank and skip subsequent rank numbers (e.g., 1, 2, 2, 4).

  14. 26 RANK.EQ =RANK.EQ(number, ref, [order]) Modern successor to RANK introduced in Excel 2010. If more than one value has the same rank, the top rank of that set of values is returned. Statistical Analysis Intermediate Classic

    Syntax

    =RANK.EQ(number, ref, [order])

    Arguments

    number
    The number whose rank you need.
    ref
    A reference to the list of numbers.
    [order]
    0 for descending, 1 for ascending.

    Sample

    =RANK.EQ(C2, $C$2:$C$5)

    Result 2

    Sample data

    Download
    ABCD
    21Rohan902
    32Kabir902 (Tied)
    43Meena951
    54Priya804
    Pro tip

    Preferred over legacy RANK for long-term compatibility and modern Excel standards.

    Common pitfall

    Ties cause subsequent rank numbers to be skipped (in 1, 2, 2, the next candidate gets rank 4, not 3).

  15. 27 RANK.AVG =RANK.AVG(number, ref, [order]) Returns the rank of a number in a list of numbers. If multiple values have the same rank, the average fractional rank is assigned to each. Statistical Analysis Intermediate Classic

    Syntax

    =RANK.AVG(number, ref, [order])

    Arguments

    number
    The number to evaluate.
    ref
    The list of numbers against which to rank.
    [order]
    Direction of rank ordering (0 descending, 1 ascending).

    Sample

    =RANK.AVG(C2, $C$2:$C$5)

    Result 2.5

    Sample data

    Download
    ABCD
    21Rohan902.5 (Split)
    32Kabir902.5 (Split)
    43Meena951.0
    54Priya804.0
    Pro tip

    Use RANK.AVG when tied candidates must split prize pool portions or average percentile standings equally.

    Common pitfall

    Result can be a fractional decimal (e.g. 2.5 or 3.5), which may confuse report readers expecting strict integers.