Excel Formulas

Excel Formulas

Working, copy-ready solutions to real Excel tasks — each with a step-by-step explanation, an interactive demo you can try right here, and a free practice workbook.

These are formula recipes: how to actually do something — sum by month, look up across two criteria, count unique values. Looking for what a single function does instead? Browse the companion Excel Functions library (500+ guides). Every recipe below links to the function references it uses.


Lookup

Find a value by another value — across rows, columns, tiers, or multiple keys.

Build clickable web, email, file, or in-workbook links with HYPERLINK.

=HYPERLINK("https://dfwexcel.com", "Visit site")
Recipe, demo & practice file →

Turn text into a live cell or sheet reference with INDIRECT.

=INDIRECT(D1 & D2)
Recipe, demo & practice file →

Chain two lookups: result of one feeds the next.

=VLOOKUP(VLOOKUP(A2, empTable, 2, 0), deptTable, 2, 0)
Recipe, demo & practice file →

Do a case-sensitive lookup with EXACT and INDEX/MATCH.

=INDEX(C2:C8, MATCH(TRUE, EXACT(A2:A8, E2), 0))
Recipe, demo & practice file →

Make a named range that auto-grows with OFFSET + COUNTA.

=OFFSET($B$2, 0, 0, COUNTA($B$2:$B$1000), 1)
Recipe, demo & practice file →

Find the closest numeric value with INDEX/MATCH + MIN/ABS.

=INDEX(items, MATCH(MIN(ABS(values-E2)), ABS(values-E2), 0))
Recipe, demo & practice file →

Return the label of the highest (or lowest) value.

=INDEX(names, MATCH(MAX(scores), scores, 0))
Recipe, demo & practice file →

Flip rows and columns with the live TRANSPOSE function.

=TRANSPOSE(A1:C2)
Recipe, demo & practice file →

Convert a column number to its letter with ADDRESS + SUBSTITUTE.

=SUBSTITUTE(ADDRESS(1, A2, 4), "1", "")
Recipe, demo & practice file →

Show the current tab name in a cell with CELL and TEXTAFTER.

=TEXTAFTER(CELL("filename", A1), "]")
Recipe, demo & practice file →

Return the first or last non-blank value with the LOOKUP trick or XLOOKUP.

=LOOKUP(2, 1/(A2:A100<>""), A2:A100)
Recipe, demo & practice file →

Return the most recent (last) match with XLOOKUP search_mode -1 or the LOOKUP trick.

=XLOOKUP(E2, A2:A8, C2:C8, , 0, -1)
Recipe, demo & practice file →

Look up across a header row and return a value below with HLOOKUP.

=HLOOKUP(E2, A1:D3, 3, FALSE)
Recipe, demo & practice file →

List every tab in the workbook with a GET.WORKBOOK named formula.

=GET.WORKBOOK(1) & T(NOW())
Recipe, demo & practice file →

Look up across several sheets by chaining IFERROR.

=IFERROR(VLOOKUP(A2, Sheet1!T, 2, 0), IFERROR(VLOOKUP(A2, Sheet2!T, 2, 0), VLOOKUP(A2, Sheet3!T, 2, 0)))
Recipe, demo & practice file →

Look up a whole column of values in one spilling formula.

=XLOOKUP(E2:E100, ids, names)
Recipe, demo & practice file →

Look up data on another sheet, optionally chosen with INDIRECT.

=VLOOKUP(E2, Products!A:B, 2, FALSE)
Recipe, demo & practice file →

Look up a value to the left with INDEX/MATCH.

=INDEX(A:A, MATCH(E2, C:C, 0))
Recipe, demo & practice file →

Return several columns from one lookup that spills the whole record.

=XLOOKUP(E2, A2:A8, B2:D8)
Recipe, demo & practice file →

Return the 2nd, 3rd, or nth match with FILTER+INDEX or INDEX/SMALL.

=INDEX(FILTER(C2:C9, A2:A9=E2), 2)
Recipe, demo & practice file →

Look up a value on two or more keys at once by joining them inside XLOOKUP or INDEX/MATCH.

=XLOOKUP(G2&"|"&G3, A2:A8&"|"&B2:B8, C2:C8)
Recipe, demo & practice file →

Partial-match lookup with * and ? wildcards.

=VLOOKUP("*"&E2&"*", table, 2, FALSE)
Recipe, demo & practice file →

Merge two tables by a key (a formula join).

=VLOOKUP(A2, products, 2, FALSE)
Recipe, demo & practice file →

Look up on a fragment using wildcards with VLOOKUP or XLOOKUP.

=VLOOKUP("*"&E2&"*", A2:B8, 2, FALSE)
Recipe, demo & practice file →

Sum or average the last N rows with a moving OFFSET window.

=SUM(OFFSET(B1, COUNT(B:B), 0, -E1, 1))
Recipe, demo & practice file →

Land a number in the right tier or tax bracket with XLOOKUP match_mode -1 — no nested IFs.

=XLOOKUP(D2, A2:A5, B2:B5, , -1)
Recipe, demo & practice file →

Look up by row and column label with INDEX and two MATCHes.

=INDEX(B2:E10, MATCH(H2, A2:A10, 0), MATCH(H3, B1:E1, 0))
Recipe, demo & practice file →

Land in the right band on both axes of a rate grid with INDEX/MATCH.

=INDEX(rates, MATCH(V1, rowBreaks, 1), MATCH(V2, colBreaks, 1))
Recipe, demo & practice file →

Pull the value where a row and a column meet, with nested XLOOKUP or INDEX/MATCH/MATCH.

=XLOOKUP(H2, A2:A6, XLOOKUP(H3, B1:D1, B2:D6))
Recipe, demo & practice file →

Two-way lookup with nested XLOOKUP (row x column).

=XLOOKUP(G1, rowLabels, XLOOKUP(G2, colLabels, dataGrid))
Recipe, demo & practice file →

Find the nearest tier with XLOOKUP match mode.

=XLOOKUP(A2, thresholds, rates, , -1)
Recipe, demo & practice file →

Return a default instead of #N/A with XLOOKUP.

=XLOOKUP(A2, ids, names, "Not found")
Recipe, demo & practice file →

Find the last (most recent) match with XLOOKUP search mode.

=XLOOKUP(A2, ids, values, , 0, -1)
Recipe, demo & practice file →

Sum

Add things up by category, period, or condition.

Build a cumulative running total with one anchored, expanding-range SUM (or SCAN).

=SUM($B$2:B2)
Recipe, demo & practice file →

Running total that resets for each group with SUMIFS.

=SUMIFS($B$2:B2, $A$2:A2, A2)
Recipe, demo & practice file →

Sum rows whose label contains a word with SUMIF wildcards.

=SUMIF(labels, "*north*", amounts)
Recipe, demo & practice file →

Total a column on two or more conditions at once with SUMIFS (AND logic).

=SUMIFS(D2:D8, B2:B8, "West", C2:C8, "Widget")
Recipe, demo & practice file →

Sum Every Nth Row

All versions

Add every Nth row with SUMPRODUCT and MOD on the row number.

=SUMPRODUCT((MOD(ROW(B2:B13)-ROW(B2), 3)=0) * B2:B13)
Recipe, demo & practice file →

Sum only filtered/visible rows with SUBTOTAL (or AGGREGATE).

=SUBTOTAL(109, B2:B100)
Recipe, demo & practice file →

Sum amounts that fall on weekdays or weekends.

=SUMPRODUCT((WEEKDAY(dates, 2) <= 5) * amounts)
Recipe, demo & practice file →

Sum a range that has errors using AGGREGATE.

=AGGREGATE(9, 6, B2:B100)
Recipe, demo & practice file →

Sum by Month

Excel 365

Total values that fall in a given month with SUMIFS and EOMONTH — year-safe, no helper column.

=SUMIFS(B:B, A:A, ">="&E2, A:A, "<="&EOMONTH(E2,0))
Recipe, demo & practice file →

Sum by Quarter

All versions

Total amounts for a quarter with SUMIFS and EOMONTH date boundaries.

=SUMIFS(B:B, A:A, ">="&E2, A:A, "<="&EOMONTH(E2,2))
Recipe, demo & practice file →

Total rows whose label contains text using SUMIF with wildcards.

=SUMIF(A2:A8, "*Pro*", B2:B8)
Recipe, demo & practice file →

Sum magnitudes ignoring sign with SUMPRODUCT + ABS.

=SUMPRODUCT(ABS(B2:B100))
Recipe, demo & practice file →

Add the same cell across many sheets with a 3D reference.

=SUM(Jan:Dec!B2)
Recipe, demo & practice file →

Total just the largest few values with LARGE and SUMPRODUCT — top 3, top 5, or N from a cell.

=SUMPRODUCT(LARGE(B2:B8, {1,2,3}))
Recipe, demo & practice file →

Sum where a field is one value OR another.

=SUM(SUMIF(region, {"East","West"}, amount))
Recipe, demo & practice file →

Build a region-by-month matrix report with one SUMIFS filled across and down.

=SUMIFS(amount, region, $A2, month, B$1)
Recipe, demo & practice file →

Count

Count rows, distinct values, and matches.

Count rows that meet several conditions at once with COUNTIFS.

=COUNTIFS(B2:B8, "West", D2:D8, ">=100")
Recipe, demo & practice file →

Count empty cells in a range with COUNTBLANK.

=COUNTBLANK(A2:A10)
Recipe, demo & practice file →

Count cells containing a word or fragment with COUNTIF and wildcards.

=COUNTIF(A2:A8, "*Pro*")
Recipe, demo & practice file →

Count text, numbers, non-blank or blank cells with the right COUNT function.

=COUNTIF(A2:A8, "*")
Recipe, demo & practice file →

Count dates that fall between two dates with COUNTIFS.

=COUNTIFS(A2:A10, ">="&E1, A2:A10, "<="&E2)
Recipe, demo & practice file →

Count how many dates fall on a weekday with SUMPRODUCT and WEEKDAY.

=SUMPRODUCT(--(WEEKDAY(A2:A10) = 2))
Recipe, demo & practice file →

Count distinct values that meet a condition.

=SUMPRODUCT((region="East")/COUNTIFS(name, name, region, "East", region, "East"))
Recipe, demo & practice file →

Count numbers, non-blanks, and blanks separately.

=COUNT(A2:A100) // numbers only =COUNTA(A2:A100) // non-blank (any type) =COUNTBLANK(A2:A100) // empty cells
Recipe, demo & practice file →

Count rows matching any of several conditions.

=SUMPRODUCT(SIGN((status="Open") + (priority="High")))
Recipe, demo & practice file →

Count how many distinct entries are in a list — COUNTA(UNIQUE()) or the classic SUMPRODUCT trick.

=COUNTA(UNIQUE(A2:A10))
Recipe, demo & practice file →

Count values above (or below) the average.

=COUNTIF(B2:B100, ">"&AVERAGE(B2:B100))
Recipe, demo & practice file →

Count values between a low and high bound with COUNTIFS.

=COUNTIFS(B2:B100, ">=70", B2:B100, "<=89")
Recipe, demo & practice file →

Count distinct values within each group with UNIQUE+FILTER or SUMPRODUCT.

=COUNTA(UNIQUE(FILTER(B2:B100, A2:A100=E2)))
Recipe, demo & practice file →

Group numbers into bands and count each with FREQUENCY or COUNTIFS.

=FREQUENCY(data, bins)
Recipe, demo & practice file →

Number each occurrence of a value with an expanding COUNTIF.

=COUNTIF($A$2:A2, A2)
Recipe, demo & practice file →

Average

Mean values by group, weighted, or filtered.

Average a range but skip exact zeros with AVERAGEIF and a <>0 criterion — blanks are already ignored.

=AVERAGEIF(B2:B100, "<>0")
Recipe, demo & practice file →

Average only filtered, visible rows with SUBTOTAL code 101 — updates live as you change the filter.

=SUBTOTAL(101, B2:B100)
Recipe, demo & practice file →

Average a column that contains errors with AGGREGATE option 6.

=AGGREGATE(1, 6, B2:B8)
Recipe, demo & practice file →

Average values for a given day of week with SUMPRODUCT and WEEKDAY — no helper column needed.

=SUMPRODUCT((WEEKDAY(dates)=2)*values) / SUMPRODUCT(--(WEEKDAY(dates)=2))
Recipe, demo & practice file →

Average by Group

All versions

Average the values in one category with AVERAGEIF / AVERAGEIFS.

=AVERAGEIF(B2:B8, E2, C2:C8)
Recipe, demo & practice file →

Average the most recent N values with OFFSET and COUNT (or TAKE in 365) — the window slides as data grows.

=AVERAGE(OFFSET(B1, COUNT(B:B)-N+1, 0, N, 1))
Recipe, demo & practice file →

Average only the best few values by nesting LARGE inside AVERAGE.

=AVERAGE(LARGE(B2:B8, {1,2,3}))
Recipe, demo & practice file →

Moving Average

All versions

Smooth a series with a rolling AVERAGE window that slides down the column.

=AVERAGE(B2:B4)
Recipe, demo & practice file →

Build a cumulative running average with AVERAGE and an expanding range — the mean of everything so far.

=AVERAGE($B$2:B2)
Recipe, demo & practice file →

Weighted Average

All versions

Weight some values more than others with SUMPRODUCT divided by total weight.

=SUMPRODUCT(B2:B5, C2:C5) / SUM(C2:C5)
Recipe, demo & practice file →

Weight recent points more with SUMPRODUCT — a responsive smoothed average divided by the weight total.

=SUMPRODUCT(values, weights) / SUM(weights)
Recipe, demo & practice file →

Min & Max

Largest and smallest values, with or without conditions.

Clamp a number between a floor and ceiling with nested MIN and MAX.

=MIN(MAX(A2, 0), 100)
Recipe, demo & practice file →

Get the 2nd, 3rd, or nth largest/smallest value with LARGE and SMALL.

=LARGE(B2:B8, 2)
Recipe, demo & practice file →

Find the biggest value in a given month with MAXIFS and date boundaries.

=MAXIFS(B:B, A:A, ">="&E2, A:A, "<="&EOMONTH(E2,0))
Recipe, demo & practice file →

Find the largest value that meets a condition with MAXIFS.

=MAXIFS(C2:C8, B2:B8, E2)
Recipe, demo & practice file →

Find the smallest value that meets a condition with MINIFS.

=MINIFS(C2:C8, B2:B8, E2)
Recipe, demo & practice file →

Logical

Decisions and tests — IF, IFS, and condition checks that label, grade, and flag.

Replace #N/A and #DIV/0! errors with a clean fallback using IFERROR / IFNA.

=IFERROR(VLOOKUP(E2, A:B, 2, 0), "")
Recipe, demo & practice file →

Compare numbers within a tolerance (floating point).

=ABS(A2 - B2) <= 0.01
Recipe, demo & practice file →

Turn scores into letter grades with IFS, nested IF, or a lookup table.

=IFS(B2>=90,"A", B2>=80,"B", B2>=70,"C", B2>=60,"D", TRUE,"F")
Recipe, demo & practice file →

Exclusive OR: TRUE when exactly one condition holds.

=XOR(A2, B2)
Recipe, demo & practice file →

Fill blank cells with the value above using IF or Go To Special.

=IF(A2="", B1, A2)
Recipe, demo & practice file →

Mark or highlight repeated values with COUNTIF — labels and conditional formatting.

=IF(COUNTIF($A$2:$A$8, A2)>1, "Duplicate", "")
Recipe, demo & practice file →

Flag rows meeting every condition with AND.

=IF(AND(B2>100, C2="In stock", D2<>"Hold"), "Ship", "")
Recipe, demo & practice file →

Grade or band values with the IFS function.

=IFS(A2>=90,"A", A2>=80,"B", A2>=70,"C", TRUE,"F")
Recipe, demo & practice file →

IF with AND / OR

All versions

Make an IF decision on several conditions at once by nesting AND or OR.

=IF(AND(B2>=50000, C2<=0.3), "Approve", "Review")
Recipe, demo & practice file →

Catch only #N/A (not all errors) with IFNA.

=IFNA(VLOOKUP(A2, table, 2, FALSE), "Not found")
Recipe, demo & practice file →

Choose between IFS, nested IF, and a lookup table.

IFS: =IFS(A2>=90,"A", A2>=80,"B", TRUE,"C") Nested: =IF(A2>=90,"A", IF(A2>=80,"B","C")) Table: =VLOOKUP(A2, bands, 2, TRUE)
Recipe, demo & practice file →

Map a value to a result with SWITCH instead of nested IFs.

=SWITCH(A2, 1, "New", 2, "Open", 3, "Closed", "Unknown")
Recipe, demo & practice file →

Show a default value when a cell is blank.

=IF(A2="", "N/A", A2)
Recipe, demo & practice file →

Convert TRUE/FALSE to 1/0 to count or sum.

=SUMPRODUCT(--(A2:A100>100))
Recipe, demo & practice file →

Turn TRUE/FALSE into Yes/No, Pass/Fail, or tick/cross.

=IF(A2>=70, "Yes", "No")
Recipe, demo & practice file →

Information

Test what's in a cell — text, errors, blanks, numbers.

Check that all required cells are filled.

=COUNTA(B2:F2) = COLUMNS(B2:F2)
Recipe, demo & practice file →

Test whether a cell contains text with ISNUMBER and SEARCH.

=ISNUMBER(SEARCH(B2, A2))
Recipe, demo & practice file →

Test whether a formula errored with ISERROR or ISNA.

=IF(ISERROR(A2/B2), "Check input", "OK")
Recipe, demo & practice file →

Test whether a cell is empty with ISBLANK inside IF.

=IF(ISBLANK(A2), "Missing", "OK")
Recipe, demo & practice file →

Tell real numbers from text-numbers with ISNUMBER and ISTEXT.

=ISNUMBER(A2)
Recipe, demo & practice file →

Count how many cells hold errors with SUMPRODUCT and ISERROR — audit a sheet in one formula.

=SUMPRODUCT(--ISERROR(B2:B100))
Recipe, demo & practice file →

Detect which cells contain formulas with ISFORMULA — audit a model or flag overwritten cells.

=ISFORMULA(A2)
Recipe, demo & practice file →

Branch on text vs numbers with ISNUMBER/ISTEXT.

=IF(ISNUMBER(A2), "Number: "&A2, IF(ISTEXT(A2), "Text", "Other"))
Recipe, demo & practice file →

Identify whether a value is a number, text, logical, or error with TYPE — branch logic on the kind.

=TYPE(A2)
Recipe, demo & practice file →

Read a cell's address, column, type or filename with the CELL function — metadata for dynamic labels.

=CELL("col", A2)
Recipe, demo & practice file →

Test whether a number is even or odd.

=ISEVEN(A2)
Recipe, demo & practice file →

Try several lookups in turn with nested IFERROR — the first hit wins, with a clean message if all miss.

=IFERROR(VLOOKUP(id,T1,2,0), IFERROR(VLOOKUP(id,T2,2,0), "Not found"))
Recipe, demo & practice file →

Turn #N/A into 0, blank, or a message with IFNA — without hiding genuine errors like IFERROR does.

=IFNA(VLOOKUP(id, table, 2, 0), 0)
Recipe, demo & practice file →

Text

Pull apart and reshape text — split, extract, clean, and join.

Capitalize names with PROPER, or force case with UPPER and LOWER.

=PROPER(A2)
Recipe, demo & practice file →

Strip extra spaces, line breaks and non-breaking spaces with TRIM, CLEAN and SUBSTITUTE.

=TRIM(CLEAN(A2))
Recipe, demo & practice file →

Turn numbers stored as text into real numbers with VALUE.

=VALUE(A2)
Recipe, demo & practice file →

Convert numbers stored as text back to real numbers with VALUE or a math nudge (*1, --) so they sum.

=VALUE(A2) // or =A2 * 1
Recipe, demo & practice file →

Count characters excluding spaces with LEN + SUBSTITUTE.

=LEN(SUBSTITUTE(A2, " ", ""))
Recipe, demo & practice file →

Count how many times a word appears in a cell.

=(LEN(A2) - LEN(SUBSTITUTE(LOWER(A2),"the",""))) / LEN("the")
Recipe, demo & practice file →

Count words in a cell by counting spaces with LEN and SUBSTITUTE.

=LEN(TRIM(A2)) - LEN(SUBSTITUTE(TRIM(A2), " ", "")) + 1
Recipe, demo & practice file →

Pull first and last names out of a full-name cell with TEXTBEFORE/AFTER or LEFT/RIGHT.

=TEXTBEFORE(A2, " ") // first name =TEXTAFTER(A2, " ") // last name
Recipe, demo & practice file →

Pull the number out of mixed text with TEXTAFTER/VALUE or MID/FIND.

=VALUE(TEXTAFTER(A2, "-"))
Recipe, demo & practice file →

Pull text between two characters with TEXTBEFORE/AFTER or MID/FIND.

=TEXTBEFORE(TEXTAFTER(A2, "("), ")")
Recipe, demo & practice file →

Extract text between parentheses with MID + FIND.

=MID(A2, FIND("(",A2)+1, FIND(")",A2)-FIND("(",A2)-1)
Recipe, demo & practice file →

Pull the domain (after @) from an email with TEXTAFTER or MID/FIND.

=TEXTAFTER(A2, "@")
Recipe, demo & practice file →

Pull the first word from a cell with LEFT + FIND.

=LEFT(A2, FIND(" ", A2 & " ") - 1)
Recipe, demo & practice file →

Pull the last word with the TRIM/RIGHT/REPT trick.

=TRIM(RIGHT(SUBSTITUTE(A2, " ", REPT(" ", 100)), 100))
Recipe, demo & practice file →

Pull the nth word from a phrase with the SUBSTITUTE/REPT/MID trick.

=TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",100)), (N-1)*100+1, 100))
Recipe, demo & practice file →

Get the value after a label like Name: with SEARCH.

=TRIM(MID(A2, SEARCH("Name:", A2) + LEN("Name:"), 100))
Recipe, demo & practice file →

Find and replace several things at once with nested SUBSTITUTE.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2, "$", ""), ",", ""), " ", "")
Recipe, demo & practice file →

Swap text inside a formula with SUBSTITUTE or REPLACE.

=SUBSTITUTE(A2, "-", " ")
Recipe, demo & practice file →

Find the position of the nth occurrence of a character with FIND/SUBSTITUTE.

=FIND("~", SUBSTITUTE(A2, "-", "~", N))
Recipe, demo & practice file →

Find where text appears in a cell with SEARCH/FIND.

=SEARCH("@", A2)
Recipe, demo & practice file →

Build initials from a name with LEFT/MID or TEXTSPLIT.

=LEFT(A2,1) & MID(A2, FIND(" ",A2)+1, 1)
Recipe, demo & practice file →

Draw in-cell bar charts, stars, and progress bars with REPT.

=REPT("|", B2)
Recipe, demo & practice file →

Insert special characters and inspect codes with CHAR, CODE and UNICHAR.

=A2 & CHAR(10) & B2
Recipe, demo & practice file →

Combine a range of cells into one delimited string with TEXTJOIN — skips blanks.

=TEXTJOIN(", ", TRUE, A2:A6)
Recipe, demo & practice file →

Join an entire range of cells with TEXTJOIN or CONCAT.

=TEXTJOIN(", ", TRUE, A2:A6)
Recipe, demo & practice file →

Hide all but the last few characters with REPT and RIGHT.

=REPT("*", LEN(A2)-4) & RIGHT(A2, 4)
Recipe, demo & practice file →

Turn 1 into 1st, 22 into 22nd, 13 into 13th.

=A2 & IF(MOD(A2,100)>=11, IF(MOD(A2,100)<=13,"th",CHOOSE(MOD(A2,10)+1,"th","st","nd","rd","th","th","th","th","th","th")), CHOOSE(MOD(A2,10)+1,"th","st","nd","rd","th","th","th","th","th","th"))
Recipe, demo & practice file →

Add leading zeros to numbers to a fixed width with TEXT.

=TEXT(A2, "00000")
Recipe, demo & practice file →

Fix PROPER's mistakes (McDonald, IBM) with SUBSTITUTE patches.

=SUBSTITUTE(PROPER(A2), "Mcd", "McD")
Recipe, demo & practice file →

Scrub extra and hidden spaces from imported text with TRIM + CLEAN.

=TRIM(CLEAN(A2))
Recipe, demo & practice file →

Flatten in-cell line breaks to spaces with SUBSTITUTE + CHAR(10).

=SUBSTITUTE(A2, CHAR(10), " ")
Recipe, demo & practice file →

Flatten in-cell line breaks to spaces with SUBSTITUTE + CHAR(10).

=TRIM(SUBSTITUTE(A2, CHAR(10), " "))
Recipe, demo & practice file →

Strip digits from text, keeping letters, with REGEXREPLACE.

=REGEXREPLACE(A2, "[0-9]", "")
Recipe, demo & practice file →

Strip unwanted characters with nested SUBSTITUTE (or keep only digits).

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-",""),"(",""),")","")," ","")
Recipe, demo & practice file →

Reverse the characters in a string with TEXTJOIN, MID and SEQUENCE.

=TEXTJOIN("", 1, MID(A2, SEQUENCE(LEN(A2), 1, LEN(A2), -1), 1))
Recipe, demo & practice file →

Capitalize only the first letter (sentence case).

=UPPER(LEFT(A2,1)) & LOWER(MID(A2,2,LEN(A2)))
Recipe, demo & practice file →

Split letters from numbers in a code like ABC123.

=REGEXEXTRACT(A2, "[A-Za-z]+") // letters =REGEXEXTRACT(A2, "[0-9]+") // numbers
Recipe, demo & practice file →

Break one cell into columns on a delimiter with TEXTSPLIT (or LEFT/MID/FIND).

=TEXTSPLIT(A2, "-")
Recipe, demo & practice file →

Split a delimited cell into rows (down a column) with TEXTSPLIT.

=TEXTSPLIT(A2, , ",")
Recipe, demo & practice file →

Normalize messy phone numbers to one format with TEXT.

=TEXT(A2, "(000) 000-0000")
Recipe, demo & practice file →

Convert Last, First into First Last and back.

=TRIM(MID(A2, FIND(",", A2) + 1, 100)) & " " & LEFT(A2, FIND(",", A2) - 1)
Recipe, demo & practice file →

Date & Time

Work with dates: ages, durations, month boundaries.

Add (or subtract) working days to a date with WORKDAY.

=WORKDAY(A2, 10, holidays)
Recipe, demo & practice file →

Shift a date by whole months or years with EDATE.

=EDATE(A2, 3)
Recipe, demo & practice file →

Express an age or duration in weeks or total months.

=(TODAY() - B1) / 7 // weeks =DATEDIF(B1, TODAY(), "m") // total months
Recipe, demo & practice file →

Turn a birthdate into an age in whole years with DATEDIF and TODAY — updates itself daily.

=DATEDIF(B2, TODAY(), "Y")
Recipe, demo & practice file →

Calculate hours between two times by subtracting and multiplying by 24.

=(B2 - A2) * 24
Recipe, demo & practice file →

Convert raw seconds into a readable h:mm:ss duration with TEXT.

=TEXT(A2/86400, "[h]:mm:ss")
Recipe, demo & practice file →

Turn text dates into real dates with DATEVALUE or a DATE rebuild.

=DATEVALUE(A2)
Recipe, demo & practice file →

Convert a time like 8:30 to 8.5 decimal hours.

=A2 * 24
Recipe, demo & practice file →

Count working days between dates, skipping weekends and holidays, with NETWORKDAYS.

=NETWORKDAYS(B1, B2, D2:D5)
Recipe, demo & practice file →

Count how many Mondays (etc.) are in a month.

=SUMPRODUCT((WEEKDAY(ROW(INDIRECT(A1&":"&EOMONTH(A1,0)))) = 2) * 1)
Recipe, demo & practice file →

Show days, hours, and minutes remaining to a target with NOW.

=INT(B1-NOW()) & "d " & TEXT(B1-NOW(), "h\h m\m")
Recipe, demo & practice file →

Count days on the 30/360 basis used in bond and accounting math with DAYS360.

=DAYS360(B1, B2)
Recipe, demo & practice file →

Count days until or since a date with simple date subtraction and TODAY.

=A2 - TODAY()
Recipe, demo & practice file →

Compute days in a year, leap-aware (365 or 366).

=DATE(YEAR(A2)+1, 1, 1) - DATE(YEAR(A2), 1, 1)
Recipe, demo & practice file →

Break an age into exact years, months, and days with DATEDIF.

=DATEDIF(B1, TODAY(), "y") & " yrs, " & DATEDIF(B1, TODAY(), "ym") & " mo, " & DATEDIF(B1, TODAY(), "md") & " days"
Recipe, demo & practice file →

Jump to the next specific weekday from a date with WEEKDAY and MOD.

=A2 + MOD(DOW - WEEKDAY(A2) + 7, 7)
Recipe, demo & practice file →

Find the first or last day of a date's quarter.

=EOMONTH(A2, MOD(3 - MOD(MONTH(A2)-1, 3), 3))
Recipe, demo & practice file →

Get the first or last day of any month with EOMONTH — leap-year safe.

=EOMONTH(A2, 0) // last day of A2's month =EOMONTH(A2, -1) + 1 // first day of A2's month
Recipe, demo & practice file →

Map any date to its fiscal year and quarter for non-January calendars.

=YEAR(A2) + (MONTH(A2)>=7) // fiscal year =MOD(CEILING(MONTH(A2)-6, 3)/3 + 3, 4)+1 // fiscal quarter
Recipe, demo & practice file →

Get the calendar date that a given year and week number starts on.

=DATE(B1,1,4) - WEEKDAY(DATE(B1,1,4),2) + 1 + (B2-1)*7
Recipe, demo & practice file →

Get the day-of-week name from a date with TEXT (dddd / ddd).

=TEXT(A2, "dddd")
Recipe, demo & practice file →

Turn a date into its calendar quarter with MONTH and ROUNDUP.

=ROUNDUP(MONTH(A2)/3, 0)
Recipe, demo & practice file →

Get the ISO or US week number of a date with ISOWEEKNUM / WEEKNUM.

=ISOWEEKNUM(A2)
Recipe, demo & practice file →

Total hours for a shift that crosses midnight with MOD.

=MOD(B2 - A2, 1) * 24
Recipe, demo & practice file →

Find the last (or first) business day of any month with WORKDAY + EOMONTH.

=WORKDAY(EOMONTH(A2,0)+1, -1, holidays)
Recipe, demo & practice file →

Turn a month number into its name (June from 6).

=TEXT(DATE(2000, A2, 1), "mmmm")
Recipe, demo & practice file →

Count whole or calendar months between two dates.

=DATEDIF(B1, B2, "m")
Recipe, demo & practice file →

Find the next anniversary, birthday, or renewal date with DATE.

=DATE(YEAR(TODAY()) + (DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))<TODAY()), MONTH(B1), DAY(B1))
Recipe, demo & practice file →

Find the nth weekday of a month (3rd Thursday) with DATE and WEEKDAY.

=DATE(Y,M,1) + MOD(DOW - WEEKDAY(DATE(Y,M,1)), 7) + (N-1)*7
Recipe, demo & practice file →

Find how many days are in a month with EOMONTH and DAY (leap-safe).

=DAY(EOMONTH(A2, 0))
Recipe, demo & practice file →

Count overlapping days between two date ranges with MIN/MAX.

=MAX(0, MIN(C1,C2) - MAX(B1,B2) + 1)
Recipe, demo & practice file →

Round time to the nearest 15 minutes (or any interval) with MROUND.

=MROUND(A2, "0:15")
Recipe, demo & practice file →

Shift a date back a year for YoY comparisons with EDATE.

=EDATE(A2, -12)
Recipe, demo & practice file →

Split daily hours into regular and overtime with MIN and MAX.

=MIN(A2, 8) // regular hours =MAX(A2 - 8, 0) // overtime hours
Recipe, demo & practice file →

Total hours past 24 using the [h]:mm format instead of letting them wrap.

=SUM(B2:B6) // then format the cell as [h]:mm
Recipe, demo & practice file →

Find which week of the month a date falls in.

=WEEKNUM(A2) - WEEKNUM(DATE(YEAR(A2), MONTH(A2), 1)) + 1
Recipe, demo & practice file →

Count business days between dates, skipping weekends and holidays, with NETWORKDAYS.

=NETWORKDAYS(B2, C2)
Recipe, demo & practice file →

Count working days left until a deadline with NETWORKDAYS.

=NETWORKDAYS(TODAY(), B1, holidays)
Recipe, demo & practice file →

Dynamic Arrays

Modern spilling formulas — FILTER, UNIQUE, SORT — that update themselves.

Aggregate an array to one value with REDUCE and LAMBDA.

=REDUCE(0, B2:B100, LAMBDA(acc, val, acc + (val>100)*val))
Recipe, demo & practice file →

Build a reusable custom function with LAMBDA + Name Manager.

=LAMBDA(price, price * 1.08)
Recipe, demo & practice file →

Build a calculated grid from row/column positions with MAKEARRAY.

=MAKEARRAY(3, 3, LAMBDA(r, c, r * c))
Recipe, demo & practice file →

Append ranges into one with VSTACK and HSTACK.

=VSTACK(Jan, Feb, Mar)
Recipe, demo & practice file →

Make a live cross-tab with PIVOTBY.

=PIVOTBY(Region, Quarter, Sales, SUM)
Recipe, demo & practice file →

Pull every record matching a condition into a report area with FILTER (or INDEX/SMALL).

=FILTER(A2:C9, B2:B9=F1, "None")
Recipe, demo & practice file →

Filter rows on AND / OR conditions with FILTER.

=FILTER(data, (Region="East")*(Sales>1000))
Recipe, demo & practice file →

Extract every row that meets a condition into a live, self-updating range with FILTER.

=FILTER(A2:C10, B2:B10=F1, "No matches")
Recipe, demo & practice file →

Flatten a grid into one column with TOCOL (or TOROW).

=TOCOL(B2:D10, 1)
Recipe, demo & practice file →

Spill a list of numbers, dates, or a grid with SEQUENCE.

=SEQUENCE(10)
Recipe, demo & practice file →

Pad an array to a fixed size with EXPAND.

=EXPAND(A2:A4, 5, 1, 0)
Recipe, demo & practice file →

Pick and reorder rows or columns with CHOOSEROWS/CHOOSECOLS.

=CHOOSECOLS(A2:E100, 3, 1, 2)
Recipe, demo & practice file →

Reference a whole spill range with the # operator.

=SUM(A2#)
Recipe, demo & practice file →

Fold a list into a grid of any width with WRAPROWS / WRAPCOLS.

=WRAPROWS(A2:A13, 3)
Recipe, demo & practice file →

Return a whole row of fields with one XLOOKUP.

=XLOOKUP(A2, IDs, data[Name]:data[Sales])
Recipe, demo & practice file →

Make running totals, max, or product with SCAN and LAMBDA.

=SCAN(0, B2:B6, LAMBDA(acc, val, acc + val))
Recipe, demo & practice file →

Show each value as a share of total with PERCENTOF.

=PERCENTOF(B2, B2:B10)
Recipe, demo & practice file →

Sort a table by several keys with SORTBY (live formula).

=SORTBY(A2:C100, A2:A100, 1, C2:C100, -1)
Recipe, demo & practice file →

Sort by a helper column or custom order with SORTBY.

=SORTBY(Names, Scores, -1)
Recipe, demo & practice file →

Split a cell into columns (or a grid) with TEXTSPLIT.

=TEXTSPLIT(A2, ",")
Recipe, demo & practice file →

Grab text before or after a delimiter with TEXTBEFORE/TEXTAFTER.

=TEXTBEFORE(A2, "@") // user =TEXTAFTER(A2, "@") // domain
Recipe, demo & practice file →

Summarize each row or column with BYROW / BYCOL.

=BYROW(B2:D10, LAMBDA(row, SUM(row)))
Recipe, demo & practice file →

Build a grouped summary in one formula with GROUPBY.

=GROUPBY(Region, Sales, SUM)
Recipe, demo & practice file →

Transform every value of an array with MAP and LAMBDA.

=MAP(B2:B100, LAMBDA(p, p * 1.08))
Recipe, demo & practice file →

Keep or remove the first/last rows with TAKE and DROP.

=TAKE(A2:C100, 5) // first 5 rows =DROP(A1:C100, 1) // drop the header row
Recipe, demo & practice file →

Build a distinct list with counts (UNIQUE + COUNTIF).

=HSTACK(UNIQUE(A2:A100), COUNTIF(A2:A100, UNIQUE(A2:A100)))
Recipe, demo & practice file →

Turn a column with repeats into a clean, alphabetized list with SORT(UNIQUE()).

=SORT(UNIQUE(A2:A10))
Recipe, demo & practice file →

Math

Number crunching — SUMPRODUCT, MOD, roots, bases, units, combinatorics, and random.

Count selections and arrangements with COMBIN, PERMUT and FACT.

=COMBIN(10, 3)
Recipe, demo & practice file →

Convert between decimal, binary, hex and octal with DEC2BIN/HEX2DEC.

=DEC2HEX(A2) // decimal → hex =DEC2BIN(A2) // decimal → binary
Recipe, demo & practice file →

Convert miles, kg, Celsius, hours and more with the CONVERT function.

=CONVERT(5, "mi", "km")
Recipe, demo & practice file →

Cycle through a list repeatedly with MOD — round-robin assignment, alternating bands, repeating schedules.

=MOD(ROW()-2, N) + 1
Recipe, demo & practice file →

Straight-line distance between two points with SQRT and SUMSQ — the Pythagorean theorem in 2D or 3D.

=SQRT(SUMSQ(x2-x1, y2-y1))
Recipe, demo & practice file →

Compute n! and build permutations and combinations with FACT, COMBIN and PERMUT.

=FACT(A2)
Recipe, demo & practice file →

Generate random numbers and random picks with RANDBETWEEN and RAND.

=RANDBETWEEN(1, 100)
Recipe, demo & practice file →

Find the greatest common divisor and least common multiple, and simplify ratios.

=GCD(A2, B2) // largest shared divisor =LCM(A2, B2) // smallest shared multiple
Recipe, demo & practice file →

INT vs TRUNC: both drop decimals, but they differ on negatives — chop toward zero vs round down.

=TRUNC(A2) // chops decimals =INT(A2) // rounds down
Recipe, demo & practice file →

Take logs in any base with LOG, LN and LOG10 — for growth rates, decibels, pH and doubling time.

=LOG(A2, B2)
Recipe, demo & practice file →

Multiply every value in a range with PRODUCT (compound factors).

=PRODUCT(B2:B6)
Recipe, demo & practice file →

Multiply arrays and add, or count/sum on multiple conditions, with SUMPRODUCT.

=SUMPRODUCT(B2:B10, C2:C10)
Recipe, demo & practice file →

Raise to a power, take any root, or compute e^x with POWER, SQRT and EXP.

=POWER(A2, B2) // or =A2^B2
Recipe, demo & practice file →

Raise to powers and take square or nth roots with POWER, ^ and SQRT.

=A2 ^ 3 // A2 cubed =A2 ^ (1/3) // cube root of A2
Recipe, demo & practice file →

Generate a random decimal in any range with RAND — scaled and shifted for simulations and test data.

=A2 + RAND() * (B2 - A2)
Recipe, demo & practice file →

Shuffle a list or sample without duplicates using SORTBY + RANDARRAY.

=SORTBY(A2:A20, RANDARRAY(ROWS(A2:A20)))
Recipe, demo & practice file →

Get remainders and build cycles, odd/even tests and wraps with MOD.

=MOD(A2, 3)
Recipe, demo & practice file →

Convert numbers to Roman numerals and back with ROMAN and ARABIC.

=ROMAN(A2)
Recipe, demo & practice file →

Build a cumulative product with PRODUCT and an expanding range — compound growth factors and indices.

=PRODUCT($B$2:B2)
Recipe, demo & practice file →

Split a total into whole groups and a remainder with QUOTIENT and MOD.

=QUOTIENT(A2, 12) // whole dozens =MOD(A2, 12) // leftover units
Recipe, demo & practice file →

Square every value and total them in one function with SUMSQ — the basis of variance, distance and least-squares.

=SUMSQ(B2:B100)
Recipe, demo & practice file →

Use SIN, COS and TAN with degrees by wrapping angles in RADIANS — heights, distances and angles.

=SIN(RADIANS(A2))
Recipe, demo & practice file →

Rank

Order and position values — leaderboards, rankings, top performers.

Rank a list highest-to-lowest with RANK.EQ, including a no-gaps tiebreaker.

=RANK.EQ(B2, $B$2:$B$8)
Recipe, demo & practice file →

Percentage

Percent change, percent of total, and percentage math.

Build a running cumulative percent (Pareto).

=SUM($B$2:B2) / SUM($B$2:$B$100)
Recipe, demo & practice file →

Calculate percent change and percent of total — the right base and formatting.

=(B2 - A2) / A2
Recipe, demo & practice file →

Round

Round to decimals, multiples, or always up/down.

Always round up or down with ROUNDUP, ROUNDDOWN, CEILING and FLOOR.

=ROUNDUP(A2, 0) // up to whole number =CEILING(A2, 10) // up to next multiple of 10
Recipe, demo & practice file →

Round halves down (2.5 to 2) instead of away from zero with a ROUNDUP minus-0.5 trick.

=ROUNDUP(A2 - 0.5, 0)
Recipe, demo & practice file →

Round up or down to the nearest multiple — to the next $5 or down to 100 — with CEILING, FLOOR and MROUND.

=CEILING(A2, 5)
Recipe, demo & practice file →

Round a percentage cleanly by rounding the underlying decimal — 2 places for whole percent, 3 for one decimal.

=ROUND(A2, 2)
Recipe, demo & practice file →

Round money cleanly to cents, nickels or whole dollars with ROUND and MROUND — fix floating-point pennies.

=ROUND(A2, 2)
Recipe, demo & practice file →

Round up to the next even or odd integer with EVEN and ODD — for pairs, panels and centered counts.

=EVEN(A2)
Recipe, demo & practice file →

Round to N significant figures with ROUND and LOG10.

=ROUND(A2, 3 - 1 - INT(LOG10(ABS(A2))))
Recipe, demo & practice file →

Round to the nearest thousand or million with ROUND and negative digits — cleaner dashboard figures.

=ROUND(A2, -3)
Recipe, demo & practice file →

Round to the nearest 0.5 (or quarter, dime) with MROUND, CEILING and FLOOR — for half-step pricing.

=MROUND(A2, 0.5)
Recipe, demo & practice file →

Round to decimal places with ROUND or to any multiple with MROUND.

=ROUND(A2, 2) // 2 decimal places =MROUND(A2, 25) // nearest multiple of 25
Recipe, demo & practice file →

Financial

Loans, savings, interest, and investment math.

Turn a lump sum into a level monthly payout.

=PMT(B3/12, B2*12, -B1)
Recipe, demo & practice file →

Find the lump-sum balloon owed at loan maturity.

=-FV(B2/12, N, B3, B1)
Recipe, demo & practice file →

Break-Even Point

All versions

Find the units needed to cover costs (fixed / contribution margin).

=B1 / (B2 - B3)
Recipe, demo & practice file →

Compute the compound annual growth rate from a start and end value.

=(B2 / B1)^(1 / B3) - 1
Recipe, demo & practice file →

Calculate a fixed loan payment from rate, term and amount with PMT.

=PMT(B1/12, B2*12, B3)
Recipe, demo & practice file →

Compound Interest

All versions

Grow a lump sum with the compound interest formula (1+rate)^periods.

=B1 * (1 + B2)^B3
Recipe, demo & practice file →

Find how long a card balance takes to clear with NPER.

=NPER(B2/12, -B3, B1)
Recipe, demo & practice file →

Depreciate an asset with SLN, DDB, or SYD (straight-line vs accelerated).

=SLN(cost, salvage, life)
Recipe, demo & practice file →

Value future cash flows today with a DCF (NPV).

=NPV(B1, B2:B6)
Recipe, demo & practice file →

Compute dividend yield and annual income.

=B1 / B2
Recipe, demo & practice file →

Estimate doubling time with the Rule of 72 and compute it exactly with NPER.

=72 / (B1*100) // Rule of 72 estimate =NPER(B1, 0, -1, 2) // exact years to double
Recipe, demo & practice file →

Convert nominal to effective annual rate (APR to APY) with EFFECT/NOMINAL.

=EFFECT(0.06, 12)
Recipe, demo & practice file →

Compute the full PITI mortgage payment with taxes & insurance.

=PMT(B2/12, B3*12, -B1) + (B4 + B5)/12
Recipe, demo & practice file →

Project what regular savings grow to with FV and compound interest.

=FV(B1/12, B2*12, -B3)
Recipe, demo & practice file →

See how extra payments shorten a loan with NPER.

=NPER(B1/12, -B2, B3)
Recipe, demo & practice file →

Find an interest-only loan payment.

=B1 * B2/12
Recipe, demo & practice file →

Find an investment's annual return where NPV is zero with IRR.

=IRR(B2:B7)
Recipe, demo & practice file →

Split each loan payment into interest and principal with IPMT and PPMT.

=PPMT(B1/12, A2, B2*12, B3) // principal in payment A2 =IPMT(B1/12, A2, B2*12, B3) // interest in payment A2
Recipe, demo & practice file →

Find the monthly deposit to reach a savings goal with PMT.

=PMT(B1/12, B2*12, 0, -B3)
Recipe, demo & practice file →

Value future cash flows in today's money with NPV (initial added outside).

=NPV(B1, B3:B7) + B2
Recipe, demo & practice file →

Find what future money or payments are worth today with PV.

=PV(B1, B2, -B3)
Recipe, demo & practice file →

Price a bond as the present value of its cash flows.

=-PV(B4, B3, B1*B2, B1)
Recipe, demo & practice file →

Tell profit margin from markup, and price for a target margin.

=(B2 - B1) / B2 // profit margin =(B2 - B1) / B1 // markup
Recipe, demo & practice file →

Compute return on investment and payback period.

=(B1 - B2) / B2
Recipe, demo & practice file →

Adjust a return for inflation (Fisher equation).

=(1 + B1) / (1 + B2) - 1
Recipe, demo & practice file →

Find the deposit to reach a target by a future date.

=PMT(B3/12, B2*12, 0, -B1)
Recipe, demo & practice file →

Value a payment that lasts forever (C/r).

=C / r
Recipe, demo & practice file →

Calculate annualized return on irregular cash-flow dates with XIRR.

=XIRR(B2:B6, A2:A6)
Recipe, demo & practice file →

Find a bond's yield to maturity with RATE.

=RATE(B4, B3, -B1, B2)
Recipe, demo & practice file →

Business

Everyday business math — invoices, commissions, budgets, pricing, payroll, inventory, and cash flow.

Age unpaid invoices into 30/60/90-day buckets.

=IFS(TODAY()-B2<=30,"0-30", TODAY()-B2<=60,"31-60", TODAY()-B2<=90,"61-90", TRUE,"90+")
Recipe, demo & practice file →

Allocate a shared cost across departments by weight.

=$E$1 * B2 / SUM($B$2:$B$10)
Recipe, demo & practice file →

Annualize a year-to-date figure into a full-year run-rate.

=B1 / B2 * 12
Recipe, demo & practice file →

Apply a discount then tax in the right order.

=B1 * (1 - B2) * (1 + B3)
Recipe, demo & practice file →

Back out the tax from a tax-inclusive price.

=B1 / (1 + B2) // net price =B1 - B1/(1 + B2) // tax portion
Recipe, demo & practice file →

Bill hours at different rates with SUMPRODUCT.

=SUMPRODUCT(B2:B10, C2:C10)
Recipe, demo & practice file →

Compute budget vs actual variance in dollars and percent.

=C2 - B2 // variance ($) =IFERROR((C2-B2)/B2, "") // variance (%)
Recipe, demo & practice file →

Compare two loans by payment and total interest with PMT.

=PMT(B2/12, B3*12, -B1)
Recipe, demo & practice file →

Find contribution margin per unit and as a ratio.

=B1 - B2 // contribution margin =(B1 - B2) / B1 // CM ratio
Recipe, demo & practice file →

Convert currency with a maintained exchange-rate table.

=B2 * VLOOKUP("EUR", $E$2:$F$6, 2, FALSE)
Recipe, demo & practice file →

Spread fixed plus variable costs into a per-unit cost.

=B1/B3 + B2
Recipe, demo & practice file →

Take gross pay down to net with stacked deductions.

=B1 - ROUND(B1*taxRate, 2) - ROUND(B1*retireRate, 2) - fixedDeductions
Recipe, demo & practice file →

Flag low stock and compute how much to reorder.

=IF(B2 <= C2, "REORDER", "OK")
Recipe, demo & practice file →

Total an invoice's line items and tax with SUMPRODUCT.

=SUMPRODUCT(B2:B10, C2:C10)
Recipe, demo & practice file →

Compare the net cost of leasing versus buying.

=leasePayment*months // lease total =price - resaleValue // buy net cost
Recipe, demo & practice file →

Look up the right sales-tax rate by region with VLOOKUP.

=amount * VLOOKUP(B2, $E$2:$F$6, 2, FALSE)
Recipe, demo & practice file →

Chain cost-to-wholesale-to-retail markups correctly.

=B1 * (1 + B2) * (1 + B3)
Recipe, demo & practice file →

Find the payback period from a cash-flow stream.

=C1 + B2
Recipe, demo & practice file →

Roll a sales log into profit by product with SUMIFS.

=SUMIFS(revenue, product, "Widget") - SUMIFS(cost, product, "Widget")
Recipe, demo & practice file →

Sum a trailing 12-month (TTM) window that slides forward.

=SUM(OFFSET(B2, 0, 0, -12, 1))
Recipe, demo & practice file →

Keep a running cash balance as money comes in and out.

=D1 + B2 - C2
Recipe, demo & practice file →

Pay a sales commission that steps up by tier with VLOOKUP.

=B2 * VLOOKUP(B2, $E$2:$F$5, 2, TRUE)
Recipe, demo & practice file →

Add a tip and split a bill among people.

=B1 * (1 + B2) / B3
Recipe, demo & practice file →

Apply volume/quantity discount pricing with a break table.

=B2 * VLOOKUP(B2, $E$2:$F$5, 2, TRUE)
Recipe, demo & practice file →

Charts

Visualize data — sparklines, dynamic charts, KPI cards, gauges, and dashboard techniques.

Add tiny in-cell line, column, or win/loss sparkline charts.

Insert → Sparklines → Line → Data range: B2:M2
Recipe, demo & practice file →

Make a chart auto-expand with new data (Table or OFFSET).

=OFFSET($B$2, 0, 0, COUNTA($B$2:$B$1000), 1)
Recipe, demo & practice file →

Build a KPI card with a value and up/down delta.

=TEXT(B1,"$#,##0")&" "&IF(B1>=B2,"▲","▼")&TEXT((B1-B2)/B2,"0%")
Recipe, demo & practice file →

Build a bullet chart (actual vs target vs bands).

Poor | Fair | Good (bands) + Actual (overlaid bar) + Target (marker)
Recipe, demo & practice file →

Combine columns and a line on two axes.

Insert → Combo Chart → set one series to Line, check Secondary Axis
Recipe, demo & practice file →

Put custom text labels on chart points from cells.

Label cell: =A2 & ": " & TEXT(B2, "$#,##0")
Recipe, demo & practice file →

Make a goal thermometer that fills toward a target.

=MIN(raised/goal, 1)
Recipe, demo & practice file →

Build a histogram by binning with FREQUENCY.

=FREQUENCY(A2:A100, C2:C6)
Recipe, demo & practice file →

Link a chart title to a cell so it updates itself.

A1: ="Sales — "&TEXT(SUM(data),"$#,##0")&" ("&period&")"
Recipe, demo & practice file →

Draw a percent-of-goal progress bar with REPT.

=REPT("█", MIN(B1/B2,1)*20) & " " & TEXT(B1/B2,"0%")
Recipe, demo & practice file →

Build a waterfall (bridge) chart with helper columns.

Base = running total before this step; Bar = the step amount
Recipe, demo & practice file →

Show streaks with a direction-only win/loss sparkline.

Insert → Sparklines → Win/Loss → Data: B2:M2
Recipe, demo & practice file →

Analysis

What-if tools — PivotTables, Goal Seek, data tables, scenarios, and sensitivity analysis.

Add a calculated field (like margin %) inside a PivotTable.

Name: Margin % Formula: = Profit / Revenue
Recipe, demo & practice file →

Compare best/base/worst scenarios with a selector and CHOOSE.

=CHOOSE($B$1, worstValue, baseValue, bestValue)
Recipe, demo & practice file →

Find break-even by driving profit to zero with Goal Seek.

Goal Seek → Set: profit cell To: 0 By changing: units cell
Recipe, demo & practice file →

Solve backward for the input that hits a target with Goal Seek.

Set cell: [result] To value: [target] By changing: [input]
Recipe, demo & practice file →

Group PivotTable dates into months, quarters, or years.

Group → select Months (and/or Quarters, Years)
Recipe, demo & practice file →

See how a loan payment moves as the rate changes.

=PMT(rate/12, N, -P)
Recipe, demo & practice file →

Sweep one input across a range with a data table.

Data → What-If Analysis → Data Table → Column input cell: [the input]
Recipe, demo & practice file →

Model total profit from a product mix with SUMPRODUCT.

=SUMPRODUCT(B2:B10, C2:C10)
Recipe, demo & practice file →

Pull a PivotTable value by field name with GETPIVOTDATA.

=GETPIVOTDATA("Sales", $A$3, "Region", "East")
Recipe, demo & practice file →

Show PivotTable values as a percent of the total.

Show Values As → % of Grand Total
Recipe, demo & practice file →

Solve the price needed to hit a profit target.

=(fixed + target) / units + variable
Recipe, demo & practice file →

Build a result grid varying two inputs at once.

Data → What-If Analysis → Data Table → Row input cell + Column input cell
Recipe, demo & practice file →

Statistics

Median, percentiles, spread, correlation, forecasting, and outliers.

Compare relative spread across datasets with STDEV / AVERAGE.

=STDEV(B2:B20) / AVERAGE(B2:B20)
Recipe, demo & practice file →

Put a margin of error around a sample mean with CONFIDENCE.

=CONFIDENCE(0.05, B1, B2)
Recipe, demo & practice file →

Measure how two columns move together with CORREL (-1 to +1).

=CORREL(B2:B100, C2:C100)
Recipe, demo & practice file →

Measure whether two variables move together with COVAR.

=COVAR(B2:B20, C2:C20)
Recipe, demo & practice file →

Flag outliers with the IQR rule (QUARTILE) or a z-score test.

=OR(B2 < Q1 - 1.5*IQR, B2 > Q3 + 1.5*IQR)
Recipe, demo & practice file →

Project future values along a trend with TREND.

=TREND(known_ys, known_xs, new_xs)
Recipe, demo & practice file →

Project a future value along a trend line with FORECAST or TREND.

=FORECAST(newX, known_Ys, known_Xs)
Recipe, demo & practice file →

Average compounding growth rates correctly with GEOMEAN.

=GEOMEAN(B2:B6)
Recipe, demo & practice file →

Average rates and ratios correctly with HARMEAN.

=HARMEAN(B2:B100)
Recipe, demo & practice file →

Measure average spread with AVEDEV — the mean absolute distance from the average, robust to outliers.

=AVEDEV(B2:B100)
Recipe, demo & practice file →

Compare mean, median, and mode for the center.

=AVERAGE(B2:B100) =MEDIAN(B2:B100) =MODE(B2:B100)
Recipe, demo & practice file →

Find the median within a group with MEDIAN+FILTER or MEDIAN(IF()).

=MEDIAN(FILTER(B2:B100, A2:A100=E2))
Recipe, demo & practice file →

Find the most frequent value (number or text) with MODE.

=MODE(B2:B20)
Recipe, demo & practice file →

Rescale values to a 0-1 scale (min-max).

=(A2 - MIN($A$2:$A$100)) / (MAX($A$2:$A$100) - MIN($A$2:$A$100))
Recipe, demo & practice file →

Compute percentiles and quartiles with PERCENTILE and QUARTILE.

=PERCENTILE(B2:B100, 0.9)
Recipe, demo & practice file →

Find a value's percentile standing within a dataset with PERCENTRANK.

=PERCENTRANK($B$2:$B$20, A2)
Recipe, demo & practice file →

Measure how well a line fits with R-squared (RSQ).

=RSQ(B2:B100, A2:A100)
Recipe, demo & practice file →

Measure spread with the range and interquartile range.

=MAX(B2:B100)-MIN(B2:B100) // range =QUARTILE(B2:B100,3)-QUARTILE(B2:B100,1) // IQR
Recipe, demo & practice file →

Rank values within each group with COUNTIFS.

=COUNTIFS(group, A2, value, ">"&B2) + 1
Recipe, demo & practice file →

Get a regression line's slope and intercept.

=SLOPE(B2:B100, A2:A100) =INTERCEPT(B2:B100, A2:A100)
Recipe, demo & practice file →

Track changing volatility with a rolling standard deviation.

=STDEV(OFFSET(B6, 0, 0, -5, 1))
Recipe, demo & practice file →

Describe distribution shape with SKEW and KURT.

=SKEW(B2:B100) =KURT(B2:B100)
Recipe, demo & practice file →

Measure spread with STDEV.S (sample) or STDEV.P (population).

=STDEV.S(B2:B100)
Recipe, demo & practice file →

Find how precise a sample mean is (standard error).

=STDEV(B2:B100) / SQRT(COUNT(B2:B100))
Recipe, demo & practice file →

Average after dropping the extreme high and low values with TRIMMEAN.

=TRIMMEAN(B2:B20, 0.2)
Recipe, demo & practice file →

Compute sample or population variance (VAR.S/.P).

=VAR.S(B2:B100)
Recipe, demo & practice file →

Measure how many standard deviations a value is from the mean.

=STANDARDIZE(A2, AVERAGE($A$2:$A$20), STDEV($A$2:$A$20))
Recipe, demo & practice file →

Advanced

Power-user formula craft — LET, LAMBDA, REGEX, and custom number formats.

Clean and reformat text by pattern with REGEXREPLACE.

=REGEXREPLACE(A2, "[^0-9]", "")
Recipe, demo & practice file →

Color or change format by value with bracketed conditions.

[Green][>=100]#,##0;[Red][<100]#,##0
Recipe, demo & practice file →

Control how numbers display with custom format codes.

#,##0;[Red](#,##0);"–";@
Recipe, demo & practice file →

Display big numbers as K or millions with a format code.

#,##0.0,, "M"
Recipe, demo & practice file →

Extract text by pattern with REGEXEXTRACT.

=REGEXEXTRACT(A2, "[0-9]+")
Recipe, demo & practice file →

Format phone or ID numbers without changing the value.

(000) 000-0000
Recipe, demo & practice file →

Hide zeros or show a dash with a number format.

#,##0;-#,##0;
Recipe, demo & practice file →

Build a clean custom function with LAMBDA + LET.

=LAMBDA(gross, disc, rate, LET(net, gross*(1-disc), net*(1+rate)))
Recipe, demo & practice file →

Name values inside a formula for clarity and speed with LET.

=LET(net, A1-A2, tax, net*0.08, net + tax)
Recipe, demo & practice file →

Write a LAMBDA that calls itself to loop without VBA.

RemoveChars = LAMBDA(txt, chars, IF(chars="", txt, RemoveChars(SUBSTITUTE(txt, LEFT(chars,1), ""), MID(chars,2,99))))
Recipe, demo & practice file →

Save a LAMBDA as a reusable custom function in Name Manager.

Name: GrossUp Refers to: =LAMBDA(net, rate, net*(1+rate))
Recipe, demo & practice file →

Validate text format with REGEXTEST (TRUE/FALSE).

=REGEXTEST(A2, "^[\w.]+@[\w.]+\.\w+$")
Recipe, demo & practice file →

Conditional Formatting

Formula-driven rules that highlight rows and cells automatically.

Add alternating row shading with ISEVEN(ROW()) — zebra stripes.

=ISEVEN(ROW())
Recipe, demo & practice file →

Build a live Gantt chart from start/end dates with a CF formula.

=AND(D$1 >= $B2, D$1 <= $C2)
Recipe, demo & practice file →

Turn numbers into a color-gradient heat map with Color Scales.

Home → Conditional Formatting → Color Scales
Recipe, demo & practice file →

Shade every cell that contains a formula (ISFORMULA).

=ISFORMULA(A1)
Recipe, demo & practice file →

Highlight cells above or below the group average automatically.

=B2 > AVERAGE($B$2:$B$20)
Recipe, demo & practice file →

Highlight values above a threshold from a cell.

=A1 > $E$1
Recipe, demo & practice file →

Highlight cells that mention a keyword with ISNUMBER + SEARCH.

=ISNUMBER(SEARCH("urgent", A1))
Recipe, demo & practice file →

Light up every cell that evaluates to an error with ISERROR.

=ISERROR(A1)
Recipe, demo & practice file →

Flag cells that are the wrong length with LEN.

=LEN(A1) <> 5
Recipe, demo & practice file →

Highlight where two columns differ.

=$A1 <> $B1
Recipe, demo & practice file →

Turn overdue dates red and upcoming ones amber with TODAY.

=B2 < TODAY()
Recipe, demo & practice file →

Shade every value that appears more than once with a COUNTIF rule.

=COUNTIF($A$2:$A$20, A2) > 1
Recipe, demo & practice file →

Shade every Nth row with a MOD rule.

=MOD(ROW(), 3) = 0
Recipe, demo & practice file →

Highlight future (or past) dates vs TODAY.

=A1 > TODAY()
Recipe, demo & practice file →

Flag missing required entries with a blank rule.

=A2 = ""
Recipe, demo & practice file →

Highlight values that appear exactly once.

=COUNTIF($A$2:$A$20, A2) = 1
Recipe, demo & practice file →

Highlight rows missing any data with COUNTBLANK in a CF rule.

=COUNTBLANK($A2:$D2) > 0
Recipe, demo & practice file →

Highlight whole rows with a formula rule — the $C2 mixed-reference trick.

=$C2="Overdue"
Recipe, demo & practice file →

Flag entries not on an allowed list with COUNTIF.

=COUNTIF($E$2:$E$10, A1) = 0
Recipe, demo & practice file →

Shade Saturdays and Sundays in a date list with WEEKDAY.

=WEEKDAY(A2, 2) > 5
Recipe, demo & practice file →

Draw a line where a sorted group changes.

=$A2 <> $A1
Recipe, demo & practice file →

Light up a whole row based on one cell using a mixed reference.

=$D2 = "Overdue"
Recipe, demo & practice file →

Flag the highest and lowest values with MAX/MIN rules.

=B2 = MAX($B$2:$B$20) // highest (green) =B2 = MIN($B$2:$B$20) // lowest (red)
Recipe, demo & practice file →

Highlight the top 10% by value with PERCENTILE.

=A1 >= PERCENTILE($A$1:$A$100, 0.9)
Recipe, demo & practice file →

Shade the top N values with a LARGE-based conditional-formatting rule.

=B2>=LARGE($B$2:$B$10, 3)
Recipe, demo & practice file →

In-Cell Data Bars

All versions

Turn a column of numbers into in-cell data bars.

Home → Conditional Formatting → Data Bars → pick a style
Recipe, demo & practice file →

Band by group, not just every other row, with a group counter.

Helper C2: =IF(A2=A1, C1, C1+1) CF rule: =ISODD($C2)
Recipe, demo & practice file →

Strike through tasks marked done with a CF rule.

=$C1 = "Done"
Recipe, demo & practice file →

Add traffic-light icons with your own number thresholds.

Home → Conditional Formatting → Icon Sets → 3 Traffic Lights
Recipe, demo & practice file →

Data Validation

Drop-down lists and controlled data entry.

Build a drop-down list with Data Validation so entry is pick-from-a-menu.

=$F$2:$F$6
Recipe, demo & practice file →

Make a cascading drop-down where the second list depends on the first (INDIRECT).

=INDIRECT(A2)
Recipe, demo & practice file →

Flag malformed email addresses with an ISNUMBER + SEARCH check.

=AND(ISNUMBER(SEARCH("@", A2)), ISNUMBER(SEARCH(".", A2, SEARCH("@", A2))), LEN(A2)-LEN(SUBSTITUTE(A2,"@",""))=1)
Recipe, demo & practice file →

Block duplicate entries with a COUNTIF data-validation rule.

=COUNTIF($A$2:$A$1000, A2) <= 1
Recipe, demo & practice file →

Limit a cell to whole numbers or a value range with Data Validation.

Whole number → between → 1 and 100
Recipe, demo & practice file →

Block entries that are too long or short with text-length validation.

Allow: Text length Data: equal to Length: 5
Recipe, demo & practice file →

More recipes publishing regularly. We’re adding new formula recipes across text, logic, conditional formatting, ranking and percentages. Want one covered next? Tell us what you’re stuck on.

Learn the formulas that matter, in one day

Our hands-on Excel Formulas & Functions class turns these recipes into skills — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class