Excel formulas cheat sheet
SheetFluent team · · 7 min read
These are the formulas most people need at work, grouped by the job they do: adding up, counting, working with conditions, looking things up, cleaning text and rounding. Each has a short example that reads like a sentence. Every formula starts with an equals sign, and every one works the same way in Excel and Google Sheets. To keep a copy, print this page or choose Save as PDF in your browser's print window.
=SUM(B2:B6)
How to read a formula
A formula starts with =, then a function name, then parentheses holding what the function works on. =SUM( reads as "add up everything from B2 to B6".
A range is a block of cells written as first cell, colon, last cell, like B2:B6. The parts inside the parentheses are called arguments, and they are separated by commas.
Text inside a formula goes in double quotes, like "East". Numbers and cell references don't. Leaving the quotes off text is one of the most common reasons a formula fails.
In all the examples below, assume a small table with names or categories in column A and numbers in column B, rows 2 to 6.
Adding up and averages
SUM adds a range. Use it for totals of units, hours or amounts.
AVERAGE adds the values and divides by how many there are.
MIN and MAX find the smallest and largest value. They are handy for spotting the lowest score or the busiest day.
In Excel, Alt+= types a SUM for the cells above the selected cell.
=SUM(B2:B6)
=AVERAGE(B2:B6)
=MIN(B2:B6)
=MAX(B2:B6)See also: How to calculate a weighted average in Excel, How to find the highest value and return the name in Excel
Counting
COUNT counts cells that hold numbers. COUNTA counts cells that aren't empty, whatever they hold. COUNTBLANK counts the empty ones.
COUNTIF counts cells that meet one condition: =COUNTIF( reads as "count the cells in A2:A6 that say East". Conditions with a comparison go in quotes too: ">50".
COUNTIFS takes several range and condition pairs, and counts rows that meet all of them.
=COUNT(B2:B6)
=COUNTA(A2:A6)
=COUNTBLANK(B2:B6)
=COUNTIF(A2:A6,"East")
=COUNTIFS(A2:A6,"East",B2:B6,">50")Totals with a condition
SUMIF adds only the rows that meet a condition. =SUMIF( reads as "add up the numbers in B where column A says East". The range you test comes first and the range you add comes last.
SUMIFS handles more than one condition. Watch the order: the range to add comes first in SUMIFS, then the pairs of range and condition.
AVERAGEIF works like SUMIF but finds the average of the matching rows.
=SUMIF(A2:A6,"East",B2:B6)
=SUMIFS(B2:B6,A2:A6,"East",B2:B6,">50")
=AVERAGEIF(A2:A6,"East",B2:B6)See also: Add up matching rows with SUMIF
Decisions
IF checks a condition and returns one result if it's true and another if it's false. =IF( reads as "if B2 is 50 or more, show Pass, otherwise Fail".
AND is true only when every condition is true. OR is true when at least one is. Put them inside IF to test two things at once.
IFERROR shows something friendlier when a formula returns an error, such as a dash instead of #DIV/0!.
=IF(B2>=50,"Pass","Fail")
=IF(AND(B2>=50,C2>=50),"Pass","Fail")
=IFERROR(B2/C2,"-")See also: Choose a result with IF
Lookups
XLOOKUP finds a value in one column and returns the matching value from another: =XLOOKUP( reads as "find E2 in column A and return what's next to it in column B". It is in Excel 2021, Excel 365 and Google Sheets.
VLOOKUP does the same in every version of Excel, but only looks to the right, and needs a column number. Always end it with FALSE for an exact match.
INDEX and MATCH together look in any direction and work in every version.
=XLOOKUP(E2,A2:A6,B2:B6)
=VLOOKUP(E2,A2:B6,2,FALSE)
=INDEX(B2:B6,MATCH(E2,A2:A6,0))See also: Find a value with VLOOKUP, XLOOKUP and INDEX MATCH with multiple criteria in Excel
Text
LEFT, RIGHT and MID take part of a text: the start, the end or a piece from the middle. LEN counts the characters.
TRIM removes extra spaces. UPPER, LOWER and PROPER change capitals. SUBSTITUTE swaps one piece of text for another.
The & sign joins text: =A2 puts a first and last name together with a space between. TEXTJOIN joins a whole range with a separator you choose. VALUE turns a number stored as text into a real number.
=LEFT(A2,3)
=TRIM(A2)
=PROPER(A2)
=A2&" "&B2
=TEXTJOIN(", ",TRUE,A2:A6)
=VALUE(B2)Math you can type without a function
Not every formula needs a function. The math signs work on their own: + adds, - subtracts, * multiplies, / divides and ^ raises to a power. =B2 multiplies two cells, and =B2 takes one away from the other.
Excel follows the usual order of operations: parentheses first, then powers, then multiply and divide, then add and subtract. =B2 doubles C2 before adding. Write =( if you mean to double the total.
A percentage is a number divided by 100. =B2 is ten percent of B2, and =B2 adds ten percent to it. For the change between two numbers, use =( and format the cell as a percentage.
Comparisons give TRUE or FALSE: =B2>50 checks whether B2 is above 50. They are the building block for IF, COUNTIF and SUMIF.
=B2*C2
=(B2+C2)*2
=B2*10%
=(C2-B2)/B2
=B2>50Rounding and fixed references
ROUND rounds to the number of decimal places you give it. ROUNDUP and ROUNDDOWN always go one way. INT rounds down to a whole number (for negatives, -8.9 becomes -9).
A dollar sign keeps a reference fixed when you fill a formula down. =B2 always multiplies by F1, on every row. Press F4 (Cmd+T on a Mac) after typing a reference to add the dollar signs.
=ROUND(B2,2)
=ROUNDUP(B2,0)
=INT(B2)
=B2*$F$1How to use this cheat sheet
Start with the formulas you need this week, not the whole list. If you build reports, SUM, SUMIF and a lookup will cover most of the work. If you clean data, TRIM, PROPER and the text functions come first.
Reading a formula is not the same as being able to write it. They stick when you type them yourself, make a mistake, and see what changes. Try each one on a small table of five rows before using it on real data.
When a formula from this page doesn't work, check the equals sign, the double quotes around text, and that each range covers the right rows. Our guide to formulas that aren't working walks through the rest.
See also: Excel formula not working? How to find the cause and fix it
Try it here
Type the formula into the answer cell, then press Enter or Check.
In B7, add up the units made from Monday to Friday.
| A | B | |
|---|---|---|
| 1 | Day | Units |
| 2 | Mon | 42 |
| 3 | Tue | 38 |
| 4 | Wed | 51 |
| 5 | Thu | 47 |
| 6 | Fri | 55 |
| 7 | Total | (answer cell) |
In B7, add up the units made from Monday to Friday.
Start practicingQuestions people ask
Is there a PDF version of this cheat sheet?
Print this page and choose Save as PDF in the print window. That gives you a copy with every formula on it.
Do these formulas work in Google Sheets?
Yes. Every formula on this page works in Google Sheets with the same name and the same parts.
Which Excel formulas should I learn first?
SUM, AVERAGE, COUNTIF, IF and a lookup (XLOOKUP or VLOOKUP). They cover most everyday tasks and come up often in job tests.
Keep practicing
Related articles
- Excel interview questions and answers7 min read
The Excel questions interviewers ask most, from references to lookups, with short answers and formulas like =SUMIF(A2:A7,C2,B2:B7).
Excel formula showing as text, not updating, or giving the wrong total? Check the equals sign, Text format, Show Formulas and Manual calculation.
- How to insert today's date in Excel6 min read
Insert today's date in Excel with Ctrl+; for a date that stays put, or =TODAY() for one that updates. Plus the time, the day name and Google Sheets.
- How to calculate GST in Excel6 min read
Add GST with =B2*1.18, take it out of an inclusive price with =B2/1.18, and split it into CGST and SGST in Excel.