Cheat sheet · 8 tasks · 38 formulas, each run on the Excel levels’ spreadsheet engine

Excel cheat sheet for data analysts

The formulas analysts use every week, grouped by the job you need done. Each one was checked on the same store data the Excel levels use, and each group links to the levels that teach it.

Formulas work the same in Microsoft Excel 365 and Google Sheets. They assume the layout below: order lines in A1:J41, a product list in L1:O121, two inputs in R1:R2. Type a formula in T2 (or the cell named) and fill down where it says so.

A1:J41A order_id · B order_date · C channel · D status · E product_id · F quantity · G unit_price · H discount_pct · I city · J email40 order lines from March 2025, stray spaces and blank cities included

L1:O121L product_id · M name · N category · O unit_costthe 120 products

Q1:R2R1 tax rate 8.25% · R2 price threshold 75input cells, labels in Q

Formulas, references, fill down

Line total (type in K2, fill down)

=F2*G2*(1-H2/100)

Relative references move as you fill: row 3 reads F3, G3, H3.

Lock the input cell with $

=G2*(1+$R$1)

Without $, filling down turns R1 into R2, R3 …, so every row after the first reads the wrong cell. F4 cycles $R$1 → R$1 → $R1 → R1.

Lock only the column or only the row

=$G2*R$1

$G2 keeps column G when filled right; R$1 keeps row 1 when filled down.

Share of the column total

=G2/SUM($G$2:$G$41)

Summarise a range

Total, average, middle value

=SUM(F2:F41)
=AVERAGE(G2:G41)
=MEDIAN(G2:G41)

Smallest, largest, 3rd largest

=MIN(G2:G41)
=MAX(G2:G41)
=LARGE(G2:G41,3)

Count numbers, filled cells, blanks

=COUNT(G2:G41)
=COUNTA(I2:I41)
=COUNTBLANK(I2:I41)

COUNT counts numbers only; COUNTA counts anything that is not empty.

Round the result

=ROUND(AVERAGE(G2:G41),2)
=ROUNDUP(F2/4,0)

ROUND changes the value; a number format only changes how it looks.

Multiply two columns and add up

=SUMPRODUCT(F2:F41,G2:G41)

Decisions: IF, IFS, AND, OR

Two outcomes

=IF(G2>=$R$2,"high","low")

Several bands, first match wins

=IFS(G2<50,"under 50",G2<200,"50-199",TRUE,"200+")

The final TRUE is the catch-all. Without it, a value no test matches gives #N/A.

All conditions true

=IF(AND(C2="web",G2>200),"review","")

Any condition true

=IF(OR(D2="cancelled",D2="refunded"),"lost","kept")

Group and count: COUNTIFS, SUMIFS

Count rows that match

=COUNTIF(C2:C41,"web")
=COUNTIFS(C2:C41,"web",D2:D41,"completed")

Sum or average where rows match

=SUMIFS(F2:F41,C2:C41,"app",D2:D41,"completed")
=AVERAGEIFS(G2:G41,C2:C41,"web")

SUMIFS takes the column to add first, then range/criterion pairs.

Comparisons and "not equal" in criteria

=COUNTIFS(G2:G41,">=75",D2:D41,"<>cancelled")

Criterion from a cell

=COUNTIFS(G2:G41,">="&R2)

Join the operator and the cell with &. ">=R2" would look for the text R2.

Largest value where rows match

=MAXIFS(G2:G41,C2:C41,"marketplace")

A channel × status table from one formula (in U5)

=COUNTIFS($C$2:$C$41,$T5,$D$2:$D$41,U$4)

Channels down T5:T7, statuses across U4:V4. Type in U5 and fill right and down: $C/$D stay put, $T5 keeps the column, U$4 keeps the row.

Join two tables: lookups

XLOOKUP (Excel 365, Google Sheets)

=XLOOKUP(E2,$L$2:$L$121,$M$2:$M$121,"not found")

Exact match by default; the 4th argument replaces #N/A.

INDEX / MATCH (every version)

=INDEX($N$2:$N$121,MATCH(E2,$L$2:$L$121,0))

The 0 in MATCH means exact match. Leave it out and you get the nearest smaller key.

VLOOKUP, exact match

=VLOOKUP(E2,$L$2:$O$121,3,FALSE)

Without FALSE, VLOOKUP does an approximate match and returns wrong rows on unsorted data. It also breaks when a column is inserted.

Catch a missing key

=IFNA(INDEX($M$2:$M$121,MATCH(E2,$L$2:$L$121,0)),"missing")

Clean and split text

Remove stray spaces, fix case

=TRIM(I2)
=PROPER(TRIM(I2))
=UPPER(C2)

Text before and after a character

=LEFT(J2,FIND("@",J2)-1)
=MID(J2,FIND("@",J2)+1,100)

Join text

=C2&" / "&D2
=TEXTJOIN(", ",TRUE,C2,D2,I2)

TEXTJOIN with TRUE skips empty cells, so a missing city leaves no ", ," gap.

Replace part of a text, length

=SUBSTITUTE(J2,"@"," at ")
=LEN(TRIM(I2))

Text that looks like a number

=VALUE("42.50")
=ISNUMBER(G2)

Numbers stored as text sit left-aligned and SUM ignores them. VALUE converts.

Dates

Parts of a date

=YEAR(B2)
=MONTH(B2)
=WEEKDAY(B2,2)

WEEKDAY with 2 numbers Monday as 1 and Sunday as 7.

A month key for grouping

=TEXT(B2,"yyyy-mm")

TEXT returns text, which groups and sorts well but no longer does date maths.

End of month, next month

=EOMONTH(B2,0)
=EDATE(B2,1)

Days between two dates

=DATE(2025,12,31)-B2
=DATEDIF(B2,DATE(2025,12,31),"m")

Dates are numbers (days), so subtraction gives days. DATEDIF gives whole months or years.

Count rows in a date range

=COUNTIFS(B2:B41,">="&DATE(2025,1,1),B2:B41,"<"&DATE(2025,2,1))

Missing values, errors, duplicates

Fill a blank with a label

=IF(ISBLANK(I2),"unknown",TRIM(I2))

Replace an error with a value

=IFERROR(G2/F2,0)

IFERROR hides every error, typos included. Use IFNA when only "not found" is expected.

Flag duplicates

=COUNTIF($J$2:$J$41,J2)>1

TRUE on every copy, the first one included.

Keep the first copy only

=COUNTIF($J$2:J2,J2)=1

The range grows as you fill down, so only the first time a value appears is TRUE.

Flag impossible values

=IF(F2<=0,"check quantity","")

Shortcuts and menus (Windows; on a Mac use Cmd)

Cycle $ in a reference
F4 while editing (Mac: Cmd+T)
Fill down / right
Ctrl+D / Ctrl+R, or double-click the fill handle
Jump to the end of the data
Ctrl+Arrow; add Shift to select
Sum the cells above
Alt+=
Turn a range into a table
Ctrl+T
Filter buttons on / off
Ctrl+Shift+L
Show formulas instead of values
Ctrl+`
Today's date as a value
Ctrl+;
Paste values only
Ctrl+Alt+V, then V
Pivot table
Insert › PivotTable: rows, columns, values, filters
Remove duplicates
Data › Remove Duplicates (keeps the first copy)
Split a column
Data › Text to Columns

https://analystquest.com/resources/excel-cheat-sheet/ · Free levels to practise every snippet: analystquest.com

More resources

Cheat sheet

SQL cheat sheet

SQL cheat sheet grouped by task: filter, group and count, join, NULLs, dates, CTEs and window functions. Every query runs on a real store database.

Cheat sheet

pandas cheat sheet

pandas cheat sheet grouped by task: filter rows, groupby, merge, missing values, text cleaning and dates. Every snippet runs on a real store dataset.

Interview prep

Interview questions

Questions from real analyst interviews, each with a model answer, the answer that loses points and a level to practise it. Terms you are unsure of are in the glossary.

Pick what may run on this site. You can change this any time from "Cookie settings" at the bottom of every page.