Skip to Content

Spreadsheets

Formulas

The same formulas you use in Excel. SUM, VLOOKUP, IF — they all work here.

How Formulas Work

Type = then your calculation. You can add cells, use functions, or do math.

=A1+B1 Add two cells =SUM(A1:A10) Add up a range =(A1+B1)*C1 Use parentheses for order
Formula bar showing a VLOOKUP formula
The formula bar shows your formula with hints for each parameter
Tip

Start typing a function name and press Tab to autocomplete it.

Formula autocomplete dropdown
Suggestions appear as you type, with descriptions for each function

Cell References

The Basics

ReferenceWhat it meansExample
A1One cell=A1*2
A1:B10A range of cells=SUM(A1:B10)
A:AA whole column=SUM(A:A)
1:1A whole row=SUM(1:1)

Relative vs Absolute

When you copy a formula, references change by default. Add $ to lock a row or column.

TypeSyntaxWhen you copy it…
RelativeA1Changes to match the new position
Lock column$A1Column stays A, row changes
Lock rowA$1Row stays 1, column changes
Lock both$A$1Never changes
Tip

Press F4 while editing a reference to cycle through these options.

Referencing Other Sheets

Use the sheet name followed by ! to pull data from another sheet:

=Sheet2!A1 One cell from Sheet2 =SUM(Sheet2!A1:A10) A range from Sheet2 ='Sales Data'!B5 Sheet name with spaces needs quotes

All Formulas by Category

Math & Statistics

FormulaWhat it doesExample
SUMAdd numbers=SUM(A1:A10)
AVERAGEGet the average=AVERAGE(B1:B100)
COUNTCount numbers=COUNT(A:A)
COUNTACount non-empty cells=COUNTA(A:A)
MINFind the smallest=MIN(A1:A100)
MAXFind the largest=MAX(A1:A100)
ROUNDRound to X decimals=ROUND(A1, 2)
ABSRemove negative sign=ABS(A1)
SQRTSquare root=SQRT(A1)
POWERRaise to a power=POWER(A1, 2)
MEDIANFind the middle value=MEDIAN(A1:A100)
STDEVStandard deviation=STDEV(A1:A100)

Lookup & Reference

FormulaWhat it doesExample
VLOOKUPLook up a value in a table=VLOOKUP(A1, B:C, 2, FALSE)
HLOOKUPLook up horizontally=HLOOKUP(A1, 1:2, 2, FALSE)
INDEXGet cell at row/column=INDEX(A1:C10, 2, 3)
MATCHFind position of a value=MATCH(A1, B:B, 0)
OFFSETGet cell offset from another=OFFSET(A1, 2, 1)
ROWGet row number=ROW(A5)
COLUMNGet column number=COLUMN(C1)
Tip

INDEX + MATCH is more flexible than VLOOKUP. It can look up in any direction:

=INDEX(C:C, MATCH(A1, B:B, 0))

Logic

FormulaWhat it doesExample
IFIf-then-else=IF(A1>100, "High", "Low")
ANDTrue if all conditions pass=AND(A1>0, B1>0)
ORTrue if any condition passes=OR(A1>100, B1>100)
NOTFlip true/false=NOT(A1>100)
IFSMultiple if-then checks=IFS(A1>90,"A", A1>80,"B", TRUE,"C")
SWITCHMatch a value=SWITCH(A1, 1,"One", 2,"Two", "Other")
IFERRORShow something else on error=IFERROR(A1/B1, 0)
ISBLANKCheck if cell is empty=ISBLANK(A1)

Text

FormulaWhat it doesExample
CONCATENATEJoin text together=CONCATENATE(A1, " ", B1)
LEFTGet first X characters=LEFT(A1, 3)
RIGHTGet last X characters=RIGHT(A1, 3)
MIDGet characters from middle=MID(A1, 2, 5)
LENCount characters=LEN(A1)
TRIMRemove extra spaces=TRIM(A1)
UPPERMake uppercase=UPPER(A1)
LOWERMake lowercase=LOWER(A1)
PROPERCapitalize Each Word=PROPER(A1)
FINDFind text position=FIND("@", A1)
SUBSTITUTEReplace text=SUBSTITUTE(A1, "old", "new")
Tip

You can also join text with &: =A1 & " " & B1

Date & Time

FormulaWhat it doesExample
TODAYToday’s date=TODAY()
NOWCurrent date and time=NOW()
DATECreate a date=DATE(2024, 12, 25)
YEARGet the year=YEAR(A1)
MONTHGet the month=MONTH(A1)
DAYGet the day=DAY(A1)
WEEKDAYDay of week (1-7)=WEEKDAY(A1)
DATEDIFDays between dates=DATEDIF(A1, B1, "D")
EDATEAdd months to a date=EDATE(A1, 3)
EOMONTHLast day of month=EOMONTH(A1, 0)

Financial

FormulaWhat it doesExample
PMTMonthly loan payment=PMT(0.05/12, 360, 200000)
PVPresent value=PV(0.05, 10, -1000)
FVFuture value=FV(0.05, 10, -1000)
NPVNet present value=NPV(0.1, A1:A10)
IRRInternal rate of return=IRR(A1:A10)

Real Examples

Running Total

Add up everything from the start to the current row:

=SUM($A$1:A1)

Put this in B1 and copy down. $A$1 stays locked. A1 moves as you copy.

Percentage of Total

Show each value as a percent of the sum:

=A1/SUM($A$1:$A$10)

Format the cell as a percentage to see “25%” instead of “0.25”.

Letter Grades

Turn scores into letter grades:

=IFS(A1>=90,"A", A1>=80,"B", A1>=70,"C", A1>=60,"D", TRUE,"F")

Find Duplicates

Check if a value appears more than once:

=COUNTIF($A$1:$A$100, A1)>1

Returns TRUE for duplicates. Use with conditional formatting to highlight them.

When Things Go Wrong

Formulas show error codes when there’s a problem:

ErrorWhat it meansHow to fix it
#DIV/0!Dividing by zeroCheck if the divisor is empty or zero
#VALUE!Wrong data typeYou used text where a number belongs
#REF!Missing cellA cell you referenced was deleted
#NAME?Unknown functionCheck for typos in the function name
#N/ANot foundVLOOKUP couldn’t find the value
#NUM!Bad numberThe result is too large or invalid
Tip

Use IFERROR to show a friendly message instead of an error:

=IFERROR(A1/B1, "N/A")

Next Steps

Last updated on