Excel and Google Sheets Formulas Cheat Sheet

These formulas work in Excel, Google Sheets and LibreOffice. Cell references such as B2 are examples, so use your own.

Totals and counts

FormulaWhat it does
=SUM(B2:B10)Adds the numbers in a range
=AVERAGE(B2:B10)Average of the range
=MIN(B2:B10) =MAX(B2:B10)Smallest and largest
=COUNT(B2:B10)How many cells hold numbers
=COUNTA(B2:B10)How many cells are not empty
=SUMIF(A2:A10,"Food",B2:B10)Adds B where A equals “Food”
=COUNTIF(A2:A10,">50")Counts cells above 50
=ROUND(B2,2)Rounds to 2 decimal places

Logic

FormulaWhat it does
=IF(B2>=40,"Pass","Fail")Chooses between two results
=IF(AND(B2>40,C2>40),"Pass","Fail")Both conditions must be true
=IF(OR(B2>40,C2>40),"Pass","Fail")Either condition can be true
=IFERROR(B2/C2,0)Shows 0 instead of an error

Lookups

FormulaWhat it does
=VLOOKUP(E2,A2:C10,3,FALSE)Finds E2 in the first column and returns column 3
=XLOOKUP(E2,A2:A10,C2:C10)A newer, more flexible lookup (Excel 365 and Sheets)
=INDEX(C2:C10,MATCH(E2,A2:A10,0))Works in every version and can look left

Text

FormulaWhat it does
=A2&" "&B2Joins text
=TRIM(A2)Removes extra spaces
=UPPER(A2) =LOWER(A2) =PROPER(A2)Changes case
=LEFT(A2,3) =RIGHT(A2,3)First or last characters
=LEN(A2)Number of characters
=SUBSTITUTE(A2,"-","")Replaces text

Dates

FormulaWhat it does
=TODAY()Today’s date
=DATEDIF(A2,TODAY(),"Y")Whole years between two dates, such as an age
=EDATE(A2,6)The date 6 months later
=NETWORKDAYS(A2,B2)Working days between two dates

Money

FormulaWhat it does
=PMT(9%/12,60,-1000000)Monthly EMI for ₹10 lakh at 9% over 60 months
=FV(12%/12,120,-5000)Value of a ₹5,000 monthly SIP after 10 years at 12% a year
=(B2/A2)^(1/C2)-1CAGR from start A2 to end B2 over C2 years
=XIRR(values,dates)Return for cash flows on different dates

Use $ to lock a reference, as in $B$2, when you copy a formula down a column.

↑ ↓ navigateEnter openEsc close