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 1

Math & Arithmetic

  1. 01 SUM =SUM(number1, [number2], ...) Adds all numbers in a range of cells, multiple non-contiguous ranges, or individual numeric constants. Ideal for aggregating financial rows, totals, and sales volumes. Math & Arithmetic Beginner Classic

    Syntax

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

    Arguments

    number1
    The first number, cell reference, or continuous range to sum.
    [number2, ...]
    Optional additional numbers, cell references, or disjoint ranges (up to 255 total arguments).

    Sample

    =SUM(C2:C5)

    Result 1450

    Sample data

    Download
    ABCD
    2E-101HR350Active
    3E-102IT400Active
    4E-103Sales450Active
    5E-104Finance250Active
    Pro tip

    Press Alt + = on Windows (or Cmd + Shift + T on Mac) for instant AutoSum on currently selected rows or columns.

    Common pitfall

    Text strings inside ranges are silently ignored, but typing text directly as an argument like =SUM("test", 10) throws a #VALUE! error.

  2. 02 SUMIF =SUMIF(range, criteria, [sum_range]) Calculates the sum of values in a range that satisfy a single condition. If sum_range is omitted, the cells in range itself are totaled. Math & Arithmetic Intermediate Classic

    Syntax

    =SUMIF(range, criteria, [sum_range])

    Arguments

    range
    The range of cells you want evaluated by criteria.
    criteria
    The condition in the form of a number, expression, cell reference, text, or wildcard.
    [sum_range]
    The actual cells to sum if they meet criteria. If omitted, range is summed directly.

    Sample

    =SUMIF(B2:B5, "HR", C2:C5)

    Result 600

    Sample data

    Download
    ABCD
    2E-101HR350Evaluated (Match)
    3E-102IT400Skipped
    4E-103HR250Evaluated (Match)
    5E-104Sales450Skipped
    Pro tip

    Wildcards like * (any sequence of characters) and ? (any single character) can be used in criteria strings (e.g., "*North*").

    Common pitfall

    Range and sum_range should be the exact same size; size mismatches can yield misaligned calculations or silent errors.

  3. 03 SUMIFS =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) Adds cells in a range that meet multiple criteria. Unlike SUMIF, the sum_range is placed FIRST to support multiple criteria pairs seamlessly. Math & Arithmetic Intermediate Classic

    Syntax

    =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

    Arguments

    sum_range
    The specific range of numeric cells you intend to calculate totals for.
    criteria_range1
    The first range to evaluate with criteria1.
    criteria1
    Condition 1 that determines which cells will be included.
    [criteria_range2, criteria2]
    Subsequent ranges and conditions (up to 127 condition pairs).

    Sample

    =SUMIFS(C2:C5, B2:B5, "HR", D2:D5, "01-Jan")

    Result 350

    Sample data

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

    Remember that SUMIFS puts sum_range FIRST, whereas legacy SUMIF puts sum_range LAST.

    Common pitfall

    All criteria ranges must have the exact same number of rows and columns as sum_range, or Excel returns #VALUE!.

  4. 04 ROUND =ROUND(number, num_digits) Rounds a number to a specified precision. If num_digits is greater than 0, rounds to decimals; if 0, rounds to nearest whole integer; if less than 0, rounds to tens, hundreds, or thousands. Math & Arithmetic Beginner Classic

    Syntax

    =ROUND(number, num_digits)

    Arguments

    number
    The numeric value or cell containing the decimal number you want to round.
    num_digits
    Number of decimal places to round to. 0 rounds to whole integer, negative values round to tens/hundreds.

    Sample

    =ROUND(B2, 2)

    Result 34.5

    Sample data

    Download
    ABCD
    2Item 134.49834.50Rounds up from 8
    3Item 2125.642125.64Rounds down from 2
    4Item 389.55589.565 rounds upward
    Pro tip

    Use num_digits = -1 to round to the nearest 10, or -2 for the nearest 100 (e.g. ROUND(1234, -2) yields 1,200).

    Common pitfall

    Changing cell display formatting only hides decimals visually; ROUND actually changes the underlying numerical value.

  5. 05 ROUNDUP =ROUNDUP(number, num_digits) Behaves like ROUND, except that it always rounds numbers upward away from zero, essential for calculating container counts, shipping crates, and packaging minimums. Math & Arithmetic Beginner Classic

    Syntax

    =ROUNDUP(number, num_digits)

    Arguments

    number
    Any real number that you want rounded upward.
    num_digits
    The number of digits to which you want to round the number.

    Sample

    =ROUNDUP(B2, 0)

    Result 35

    Sample data

    Download
    ABCD
    2BX-0134.1235Pushed up to 35
    3BX-0212.0113Even 0.01 pushes up
    4BX-0399.90100Pushed up to 100
    Pro tip

    Use ROUNDUP(val, 0) whenever you need ceiling integers (e.g. calculating billable hours or shipping boxes).

    Common pitfall

    For negative numbers, ROUNDUP rounds away from zero (-3.1 becomes -4, not -3).

  6. 06 ROUNDDOWN =ROUNDDOWN(number, num_digits) Behaves like ROUND, except that it always rounds numbers downward toward zero. Truncates digits past the designated decimal point. Math & Arithmetic Beginner Classic

    Syntax

    =ROUNDDOWN(number, num_digits)

    Arguments

    number
    The real number you want rounded downward.
    num_digits
    Number of decimal digits to keep without rounding up.

    Sample

    =ROUNDDOWN(B2, 2)

    Result 34.89

    Sample data

    Download
    ABCD
    2Widget A34.89934.89Leaves exact .89
    3Widget B120.954120.95Drops trailing digits
    4Widget C45.67845.67Truncates downward
    Pro tip

    ROUNDDOWN is identical in behavior to TRUNC when num_digits is positive.

    Common pitfall

    For negative numbers, ROUNDDOWN rounds toward zero (-3.8 becomes -3).

  7. 07 INT =INT(number) Rounds a real number down to the nearest integer. Extremely useful for extracting days from date-time timestamps or whole completed units. Math & Arithmetic Beginner Classic

    Syntax

    =INT(number)

    Arguments

    number
    The real number you want to round down to a whole integer.

    Sample

    =INT(B2)

    Result 12

    Sample data

    Download
    ABCD
    2Product X12.8512Decimals dropped
    3Product Y145.12145Integer portion
    4Product Z99.9999Rounds down
    Pro tip

    To extract just the time fraction from a combined date-time cell: =A2 - INT(A2).

    Common pitfall

    With negative numbers, INT rounds DOWN away from zero: INT(-4.2) is -5, whereas TRUNC(-4.2) is -4.

  8. 08 ODD =ODD(number) Rounds a positive number up to the nearest odd integer and a negative number down to the nearest negative odd integer. Math & Arithmetic Beginner Classic

    Syntax

    =ODD(number)

    Arguments

    number
    The value to round up to the nearest odd number.

    Sample

    =ODD(A2)

    Result 3

    Sample data

    Download
    ABCD
    211Odd matchAlready odd, stays 1
    323RoundedEven 2 rounds up to 3
    433Odd matchAlready odd, stays 3
    Pro tip

    If the input number is already an odd integer, ODD returns the number itself without modification.

    Common pitfall

    Non-numeric text passed into ODD triggers an immediate #VALUE! error.

  9. 09 EVEN =EVEN(number) Rounds a positive number up to the nearest even integer and a negative number down to the nearest negative even integer. Math & Arithmetic Beginner Classic

    Syntax

    =EVEN(number)

    Arguments

    number
    The value to round up to the nearest even integer.

    Sample

    =EVEN(A2)

    Result 2

    Sample data

    Download
    ABCD
    212Even TargetOdd 1 rounds up to 2
    322Even MatchAlready even, stays 2
    434Even TargetOdd 3 rounds up to 4
    Pro tip

    Use EVEN when items must be ordered in pairs (e.g. dual channels, socket pairs, or twin tires).

    Common pitfall

    0 is already considered an even number by Excel, so EVEN(0) returns 0.

  10. 10 ABS =ABS(number) Returns the absolute value of a number without regard to its sign. Crucial for financial variances, audit discrepancies, and distance metrics. Math & Arithmetic Beginner Classic

    Syntax

    =ABS(number)

    Arguments

    number
    The real number of which you want the absolute value.

    Sample

    =ABS(B2)

    Result 1500

    Sample data

    Download
    ABCD
    2Budget A-15001,500Negative converted to +
    3Budget B23002,300Positive remains unchanged
    4Budget C-450450Discrepancy magnitude
    Pro tip

    Commonly paired with SUM or AVERAGE to compute Mean Absolute Deviation (MAD) in forecasting models.

    Common pitfall

    Cannot process text representations of numbers or dates formatted as unparsed strings directly.

  11. 11 RAND =RAND() Returns a random real number between 0 and 1. A new random number is generated every single time worksheet calculations occur. Math & Arithmetic Beginner Classic

    Syntax

    =RAND()

    Arguments

    No arguments
    Takes zero arguments. Empty parentheses are mandatory.

    Sample

    =RAND()

    Result 0.742819

    Sample data

    Download
    ABCD
    2Trial 10.74281974.28Volatile
    3Trial 20.21950321.95Volatile
    4Trial 30.89412189.41Volatile
    Pro tip

    To generate a random decimal between A and B: =A + RAND() * (B - A).

    Common pitfall

    RAND is a volatile function that recalculates on every single worksheet edit. Copy and Paste-as-Values to freeze numbers.

  12. 12 RANDBETWEEN =RANDBETWEEN(bottom, top) Generates a random whole integer between two boundary values. Ideal for creating test dummy data, student scores, or sample IDs. Math & Arithmetic Beginner Classic

    Syntax

    =RANDBETWEEN(bottom, top)

    Arguments

    bottom
    The smallest integer RANDBETWEEN can return.
    top
    The largest integer RANDBETWEEN can return.

    Sample

    =RANDBETWEEN(10, 100)

    Result 68

    Sample data

    Download
    ABCD
    2Student 11068100
    3Student 21042100
    4Student 31095100
    Pro tip

    Copy and Paste as Values (Ctrl + Alt + V -> V) immediately after generating mock test data so values stop recalculating.

    Common pitfall

    Bottom must be less than or equal to Top, otherwise Excel returns a #NUM! error.