Excel Formulas

Discover the best Excel formulas, including detailed examples and functions like XLOOKUP, FILTER, UNIQUE, SUMPRODUCT, and COUNTIFS.

Excel formulas are the backbone of efficient data analysis. They allow users to perform calculations easily. This definitive guide provides hundreds of formula examples. Dive into categories like SUM, TEXT, LOOKUP, and conditional formatting to find the perfect formula for your needs.


COUNT Formulas

This section covers various formulas that help you count cells with numbers, text, errors, or based on other conditions.

FormulaRelated Functions
Count cells that contain numbersCOUNT, SUMPRODUCT, ISNUMBER
Count cells greater thanCOUNTIF, IF
Count cells that contain specific textCOUNTIF
Count cells that contain errorsISERROR, SUMPRODUCT
Count cells that do not contain errorsSUMPRODUCT, ISERROR, NOT
Count cells that begin with specific textCOUNTIF
Count cells over n charactersSUMPRODUCT, N, LEN
Count cells between two numbersCOUNTBETWEEN, COUNTIFS
Count if cells less than a given numberCOUNTIF
Count if two (or more) criteria matchCOUNTIFS, SUMPRODUCT
Count if row meets multiple criteriaROWS, FILTER, SUMPRODUCT
Count matches between two columnsSUMPRODUCT, SUM
Count numbers by the nth digitCOUNTDIGITS, COUNTIF, SUMPRODUCT
Count numbers that begin withSUMPRODUCT, LEFT
Count rows that contain specific valuesSUM, MMULT, TRANSPOSE, COLUMNS
Count total matches in two rangesSUM, COUNTIF
Count unique numeric values in a rangeCOUNTA, UNIQUE, FILTER
Count unique text values in a rangeSUM, COUNTIF, UTEXT
Count values in multiple ranges with criteriaSUM, VSTACK

SUM formulas

This chapter provides various formulas for summing cells based on specific conditions, such as the top or bottom values, every nth cell, or only visible cells in a filtered list.

FormulaRelated Functions
Calculate the running total (cumulative SUM)RTOTAL
Sum if between two numbersSUMIFS
Sum comma-separated numbers in a cellSUM, FILTERXML
Sum bottom n values in a rangeSUM, SMALL
Sum cells that contain formulasSUMPRODUCT
Sum first n matching valuesSUM, TAKE, FILTER
Sum the last or first n columns in a rangeSUM, TAKE
Sum last n rowsSUM, TAKE
Sum last n columnsSUM, TAKE
Sum the top n values in a rangeLARGE, SEQUENCE
Sum every n rowsSUM, OFFSET
Sum every nth columnSUM, MOD, FILTER, SEQUENCE
Sum every nth rowSUMN
Sum multiple rows or columnsSUM, XLOOKUP
Sum visible rows in a filtered listSUBTOTAL

TEXT and STRING manipulation formulas

Text manipulation is essential for handling and organizing data in Excel. This section provides formulas to help you modify text, extract specific parts, split strings, and format text to fit your needs.

FormulaRelated Functions
Abbreviate names or wordsABBREVIATE
Add leading zeros to a numberRIGHT, ZFILL
Convert text to numberVALUE
Extract text before or after a characterLEFT, RIGHT, FIND
Extract the nth word from a text stringTRIM, MID, LEN, SUBSTITUTE
Get the first word from some textIFERROR, LEFT, FIND
Get the last name from a nameTEXTRIGHT, SUBSTRING
Get the last word from a text stringGETLASTWORD, TRIM, RIGHT
Get a middle name from a full nameTRIM, MID, LEN
Get the first name from a full nameLEFT, TEXTLEFT
Most common text values in a rangeLET, SORT, HSTACK
Remove characters from the rightLEFT, LEN, VALUE
Remove the file extension from the file nameLEFT, FIND
Remove the first characterREPLACE
Remove text by matchingSUBSTITUTE
Remove text by positionREPLACE, SUBSTITUTE, TEXTRIGHT
Separate first and last namesRIGHT, LEN, SUBSTITUTE
Split dimensions into two partsSUBSTITUTE
Split text and numbersRIGHT, LEN, MID, FIND
Split text at specific charactersLEFT, FIND
Split text with a delimiterTRIM, MID, SUBSTITUTE
Trim text to n wordsLEFT, FIND, SUBSTITUTE

LOOKUP formulas

Use XLOOKUP, VLOOKUP, and related functions to find specific matches, return multiple results, or handle complex searches, such as case-sensitive or last-match lookups.

FormulaRelated Functions
Find the first or last positive value in a listXLOOKUP
Find the 2nd match using XLOOKUPXLOOKUP, SORTBY
Get the first text value with XLOOKUPXLOOKUP
Get last match cell containsSEARCH, ISNUMBER, XLOOKUP
Left lookup using XLOOKUPXLOOKUP
Lookup and return the nth valueNVLOOKUP
Lookup and return multiple values in one cellMLOOKUP
Lookup first negative valueXLOOKUP
Match the first error in a rangeXMATCH, ISERROR
Nested XLOOKUPXLOOKUP
Return the nth value in a rowCHOOSECOLS
VLOOKUP multiple matchesVLOOKUP
XLOOKUP across multiple worksheetsXLOOKUP
XLOOKUP binary search lookupXLOOKUP
XLOOKUP case-sensitiveXLOOKUP, EXACT
XLOOKUP find the closest matchXLOOKUP
XLOOKUP last matchXLOOKUP
XLOOKUP lookup row or columnXLOOKUP
XLOOKUP match text containsXLOOKUP
XLOOKUP name of the nth largest valueXLOOKUP
XLOOKUP return blank if blankLET, IF, XLOOKUP
XLOOKUP value between two numbersXLOOKUP
XLOOKUP with boolean or logicXLOOKUP
XLOOKUP with logical criteriaXLOOKUP, AND
XLOOKUP with multiple criteriaXLOOKUP
XLOOKUP returns all matchesFILTER
XLOOKUP for Excel 2010, 2013, 2016 and 2019DXLOOKUP

Dynamic Array

Dynamic array formulas like FILTER, UNIQUE, and VSTACK make filtering data, counting unique values, combining ranges, and extracting specific information easily.

FormulaRelated Functions
Basic filter exampleFILTER
Combine data in multiple worksheetsVSTACK, FILTER, CHOOSECOLS, LET
Combine rangesVSTACK, HSTACK
Count unique values and distinct valuesUNIQUE
Count unique values with criteriaSUM, LEN, UNIQUE, FILTER
Dynamic summary countCHOOSE, UNIQUE, COUNTIF
Extract common values from two listsFILTER, COUNTIF
Extract common values from text stringsFILTER, TEXTJOIN, TEXTSPLIT
Extract first number before a text stringVALUE, REGEXEXTRACT
Extract numbers from a text stringTEXTSPLIT, TOROW, DROP
Extract the nth number from a text stringINDEX, TEXTSPLIT, TOROW
Extract the last number from a stringVALUE, REGEXEXTRACT
FILTER case-sensitiveFILTER, EXACT
Filter data between datesFILTER
Filter data if cell contains specific textFILTER, ISNUMBER, SEARCH
Filter every nth rowFILTER, MOD, ROW, SEQUENCE
FILTER on first or last n valuesSUM, TAKE
Filter with multiple criteriaFILTER
Get a number from any position in a stringTEXTJOIN, ROW, INDIRECT, LEN
List the most frequently occurring numbersLET, UNIQUE, SORT, HSTACK
Sum numbers in single cellSUM, VALUE, TEXTSPLIT
Sum numbers with textSUM, TEXTAFTER
Random numbers without duplicatesSORTBY, UNIQUE, RANDARRAY
Unique values from multiple rangesUNIQUE, VSTACK

Conditional Formatting

Conditional formatting formulas in Excel let you highlight cells based on specific conditions, making patterns, trends, and anomalies in your data more visible.

FormulaRelated Functions
Color rankingRANK
Compare two columns (matches, differences)IF, VLOOKUP, INDEX, MATCH, XLOOKUP
Create a heat mapIF
Find errors in a rangeOR, ISBLANK
Find duplicatesCOUNTIF
Highlight every other rowMOD, ROW
Multiple conditionsAND
Percentile rank formulaPERCENTILE
Show protected cellsCELL

IF

IF formula examples using IF to check for specific text, calculate the median with conditions, and apply Boolean logic.

FormulaRelated Functions
IF cell contains specific textIF, ISNUMBER, SEARCH
IF formula to calculate medianIF, MEDIAN
IF with boolean logicIF, SUM, SUMIFS

Date and Time

FormulaRelated Functions
Add years to dateDATE, YEAR, MONTH, DAY
Calculate hours between two timesIF, MOD
Convert Date to Number [or Number to Date] in ExcelDATE, LEFT, MID, RIGHT
Extract date from text stringLEFT, MID, FIND, TEXTSPLIT
Separate date and time in different columnsINT

Financial

FormulaRelated Functions
Annual compound interest scheduleFV, SEQUENCE
Calculate cumulative loan interestCUMIPMT
Calculate cumulative loan principal paymentsCUMPRINC
Calculate interest rate for loanRATE
Calculate original loan amountPV
Calculate payment for a loanPMT
Calculate payment periods for loanNPER
Effective annual interest rateEFFECT

COLOR formulas

FormulaRelated Functions
Count cells based on colorCOUNTBYCOLOR
Color ranking formulaRANK
IF statement based on cell colorIF, COUNTBYCOLOR
Fill cell with RGB colorMYRGB

Miscellaneous

FormulaRelated Functions
Add leading zerosRIGHT
Convert boolean TRUE and FALSE to 1 or 0N
Calculate the longest winning streakLET, SCAN, LAMBDA, FILTER, FREQUENCY
Calculate probabilityPROB
Remove special charactersTEXTCLEAN

Best practices for using Excel Formulas

  1. Toggle between relative and absolute reference. First, select the cell that contains the formula and use the F2 shortcut to enter the cell edit mode. Then, press F4 to switch between the reference types.
  2. Apply autocomplete formula function. First, type an equal sign (=) and type the first character of the function. Excel shows a dynamic list of built-in functions. Next, select the function that you want to use.
  3. Use Function ScreenTips. Type an equal sign and enter the function name. To add arguments, type the opening parenthesis. A screen tip will appear and show your formula’s corresponding argument.

Useful resources to learn Formulas

Finally, if you want to learn more about Excel Formulas, we recommend the related articles below: