Learn

Excel formulas for beginners: short lessons

Each lesson takes about 30 seconds: what the function does, the pattern to type, one example and the mistake most people make. Then practice it on a live sheet. The lessons are free to read. The first 7 exercises are free too, with a free account.

Every example uses the same small sales sheet, the one you'll see on the practice page. Sales are in column B, targets in D, regions in E, units in F, contact names in G and hire dates in H. A small lookup table of regions, managers and commission rates sits in J to L, and K6 holds a report date.

The basics

SUM: add up a range

SUM adds every number in a range. A range is a block of cells written as first cell, colon, last cell.

=SUM(first:last)

Example: =SUM(B2:B7) returns 7,245. Adds the six sales in B2 through B7.

Common mistake: Starting at B1 or ending at B8. Row 1 is the header and row 8 is where the total goes, so neither belongs in the range.

Practice it: Total sales · Total units (pass)

AVERAGE: the typical value

AVERAGE adds the numbers in a range and divides by how many there are. Empty cells and text are skipped, but zeros count.

=AVERAGE(first:last)

Example: =AVERAGE(B2:B7) returns 1,207.5. The total of the six sales divided by 6.

Common mistake: Writing =SUM(B2:B7)/7 or another hand count. If a row is added, the count is wrong. AVERAGE counts for you.

Practice it: Average sale · Average units (pass)

MIN and MAX: smallest and largest

MAX returns the biggest number in a range and MIN returns the smallest. Subtract one from the other to get the spread.

=MAX(range) =MIN(range)

Example: =MAX(B2:B7)-MIN(B2:B7) returns 1,625. The gap between the best and worst sale.

Common mistake: Sorting the list to find the biggest value. Tests want a formula that still works when the numbers change.

Practice it: Spread between best and worst · Biggest sale (pass) · Smallest sale (pass)

COUNT and COUNTA: how many

COUNT counts cells that hold numbers. COUNTA counts every cell that isn't empty, text included.

=COUNT(range) =COUNTA(range)

Example: =COUNTA(A2:A7) returns 6. Counts the six names. =COUNT(A2:A7) would return 0, because names aren't numbers.

Common mistake: Using COUNT on a list of names or codes and getting 0.

Practice it: How many reps (pass)

Math and percentages

Formulas use + - * / and ^ for powers. Excel multiplies and divides before it adds and subtracts, unless you use brackets. A percentage is a decimal: 5% is 0.05.

=B2*0.05 =B2*5% =(B2-D2)/D2

Example: =B2*5% returns 62.5. Dana's 5% commission on her sale.

Common mistake: Typing =B2*5 instead of 5% or 0.05, which multiplies by five. Also: =2+3*4 is 14, not 20.

Practice it: Dana's commission · Over or under target (pass) · Percent of target (pass) · Distance from target (pass)

ROUND, ROUNDUP and ROUNDDOWN

ROUND changes a value to a set number of decimals. ROUNDUP always goes up and ROUNDDOWN always goes down. Use 0 decimals for whole numbers.

=ROUND(number, decimals)

Example: =ROUND(AVERAGE(B2:B7),0) returns 1,208. The average sale as a whole number.

Common mistake: Clicking Decrease Decimal instead. That only changes how the cell looks. The value underneath keeps every decimal, and other formulas use it.

Practice it: Rounded average (pass) · Rounded commission (pass) · Boxes needed (pass)

Absolute references: the $ sign

When you copy a formula, cell references move with it. A $ locks the part after it. $B$2 never moves, B$2 keeps the row, $B2 keeps the column.

=B2/SUM($B$2:$B$7)

Example: =B2/SUM($B$2:$B$7) returns 0.173. Dana's share of the total. Copy it down and B2 becomes B3, B4..., but the total range stays put.

Common mistake: Leaving out the $, so the copied formula divides by B3:B8, then B4:B9, and the shares come out wrong. In Excel, press F4 while typing a reference to add the $ signs.

Practice it: Dana's share of total (pass)

Conditions

IF: one of two answers

IF checks a test and returns one value when it's true and another when it's false. Tests use = <> < > <= and >=.

=IF(test, value if true, value if false)

Example: =IF(B2>D2,"Yes","No") returns Yes. Yes if Dana beat her target in D2, otherwise No.

Common mistake: Forgetting the quotes around text answers. =IF(B2>D2,Yes,No) gives #NAME?. Numbers don't need quotes.

Practice it: Hit target? · Bonus if over target (pass)

AND and OR inside IF

AND is true only when every test is true. OR is true when at least one is. Put them in the test part of IF.

=IF(AND(test1, test2), ...) =IF(OR(test1, test2), ...)

Example: =IF(AND(B2>1000,E2="East"),"Yes","No") returns Yes. Yes only if Dana sold over 1000 and is in the East.

Common mistake: Writing =IF(B2>1000 AND E2="East", ...). Excel needs the AND(...) function, not the word.

Practice it: Big East sale? (pass) · East or North? (pass)

IFS: several levels

IFS checks tests in order and returns the value for the first true one. Put the highest bar first. TRUE as the last test catches everything else.

=IFS(test1, value1, test2, value2, TRUE, otherwise)

Example: =IFS(B2>=2000,"A",B2>=1000,"B",TRUE,"C") returns B. A for 2000 or more, B for 1000 or more, C for the rest.

Common mistake: Putting the lowest bar first. B2>=1000 would catch a 2,100 sale before the 2000 test runs. IFS needs Excel 2019 or later; older versions use nested IFs.

Practice it: Letter grade (pass)

COUNTIF: count what matches

COUNTIF counts the cells in a range that meet a condition. Conditions go in quotes, like ">500" or "West". Text matches ignore capital letters.

=COUNTIF(range, "condition")

Example: =COUNTIF(B2:B7,">500") returns 5. How many sales are above 500.

Common mistake: Leaving the quotes off: =COUNTIF(B2:B7,>500) won't work. To use a cell in the condition, join it: ">"&D2. A * matches any characters: "J*" matches names starting with J.

Practice it: Sales over 500 · Reps under target (pass) · Reps in the West (pass) · Hired before 2020 (pass) · Reps over 50 units (pass)

SUMIF and AVERAGEIF: add what matches

SUMIF checks one range and adds the matching cells from another. AVERAGEIF works the same way but averages them. Conditions work like COUNTIF's, so ">"&D2 uses the value in D2.

=SUMIF(range to check, "condition", range to add)

Example: =SUMIF(E2:E7,"East",B2:B7) returns 4,950. Checks the regions in column E and adds the East sales from column B.

Common mistake: Mixing up the order. The range to check comes first and the range to add comes last. If you leave the last one out, SUMIF adds the checked cells themselves.

Practice it: Sales from reps over 1000 · East region sales (pass) · Average East sale (pass) · West region sales (pass) · Average of sales over 500 (pass) · East share of sales (pass) · Sales above Dana's target (pass)

COUNTIFS and SUMIFS: two or more conditions

These take pairs: a range, then its condition, then the next range and condition. A row counts only when every condition is true.

=COUNTIFS(range1, cond1, range2, cond2) =SUMIFS(sum range, range1, cond1, ...)

Example: =COUNTIFS(E2:E7,"East",B2:B7,">1000") returns 3. East reps who sold more than 1000.

Common mistake: SUMIFS puts the range to add first, the opposite of SUMIF. =SUMIFS(B2:B7, E2:E7, "East", ...) is right.

Practice it: East reps over 1000 (pass) · Big East sales total (pass) · West reps under target (pass)

IFERROR: a fallback instead of an error

IFERROR returns the formula's result, or a value you choose if the formula gives any error, like #DIV/0! or #N/A.

=IFERROR(formula, value if error)

Example: =IFERROR(B2/F2,0) returns 25. Dana's price per unit, or 0 if the units cell were empty.

Common mistake: Wrapping everything in IFERROR. It hides every error, including real mistakes in your formula. Use it where you expect blanks or missing values.

Practice it: Price per unit (pass) · Lookup with a fallback (pass)

Cleaning up text

UPPER, LOWER, PROPER and TRIM

UPPER and LOWER change the case of text. PROPER capitalizes each word. TRIM removes spaces at the ends and turns double spaces into single ones.

=PROPER(TRIM(cell))

Example: =PROPER(TRIM(G2)) returns Dana Ruiz. Turns the messy " dana ruiz" in G2 into Dana Ruiz.

Common mistake: Fixing names by retyping them. Tests on data entry roles want the formula, so it works on the whole column.

Practice it: Name in capitals (pass) · Clean up a name (pass) · Name in lowercase (pass)

LEFT, RIGHT, MID, LEN and FIND

LEFT and RIGHT take characters from the start or end. MID takes them from the middle. LEN counts characters. FIND gives the position of one piece of text inside another.

=LEFT(text, count) =MID(text, start, count) =FIND(" ", text)

Example: =LEFT(A2,3) returns Dan. The first three letters of Dana's name.

Common mistake: Hard-coding a length that only fits one row. To split "Dana Ruiz" at the space, use FIND(" ", ...) to locate it instead of counting by hand.

Practice it: Name length (pass) · First name from contact (pass) · Last name from contact (pass)

Joining text: & and TEXTJOIN

The & sign joins pieces of text. Spaces, dashes and other fixed text go inside quotes. TEXTJOIN joins a whole range with a separator.

=A2&" "&E2 =TEXTJOIN(", ",TRUE,range)

Example: =A2&" ("&E2&")" returns Dana (East). Builds the label Dana (East).

Common mistake: Forgetting the spaces. =A2&E2 gives DanaEast. Put a space inside quotes: " ".

Practice it: Rep code (pass) · Build an email address (pass) · List every rep (pass) · Name and region label (pass)

Lookups

VLOOKUP: find a value in a table

VLOOKUP searches the first column of a table for a value and returns something from the same row. You tell it which column by number, counting from the table's left edge.

=VLOOKUP(what to find, table, column number, FALSE)

Example: =VLOOKUP(E2,$J$2:$L$4,2,FALSE) returns Ann Cole. Finds East in J2:J4 and returns column 2 of the table, the manager.

Common mistake: Leaving off FALSE. Without it VLOOKUP uses approximate match and can return the wrong row with no error. Also lock the table with $ before copying the formula down.

Practice it: Look up the manager (pass) · Commission by region (pass)

XLOOKUP: the newer lookup

XLOOKUP takes where to look and what to return as two separate ranges, so it can look left and there's no column number to count. A fourth argument sets what to show when nothing matches.

=XLOOKUP(what to find, look in, return from, [if not found])

Example: =XLOOKUP(E3,J2:J4,K2:K4) returns Ben Ortiz. Finds West and returns its manager.

Common mistake: Using it on an older Excel. XLOOKUP needs Excel 2021 or Microsoft 365 (Google Sheets has it too). Tests on older versions expect VLOOKUP or INDEX MATCH.

Practice it: XLOOKUP the manager (pass) · XLOOKUP the rate (pass) · Lookup with a default (pass)

INDEX and MATCH

MATCH finds the position of a value in a range. INDEX returns the value at a position. Together they do a lookup in any direction.

=INDEX(return range, MATCH(what to find, look range, 0))

Example: =INDEX(B2:B7,MATCH("Priya",A2:A7,0)) returns 2,100. MATCH finds Priya in position 3, and INDEX returns the 3rd sale.

Common mistake: Leaving the 0 off MATCH. 0 means exact match. Without it MATCH can return the wrong position.

Practice it: INDEX and MATCH (pass) · Where is Omar? (pass) · Omar's manager (pass)

Dates

Dates: YEAR, MONTH, DAY and DATE

Excel stores a date as a number, counting days. YEAR, MONTH and DAY pull out the parts. DATE builds a date from a year, month and day.

=YEAR(date) =DATE(year, month, day)

Example: =YEAR(H2) returns 2018. The year Dana was hired.

Common mistake: Using LEFT(H2,4) to get the year. Because the date is a number underneath, LEFT returns digits of that number, not the year.

Practice it: Year hired (pass) · Month hired (pass)

Date math: days, DATEDIF and EOMONTH

Subtract two dates to get the days between them. DATEDIF counts full years, months or days. EOMONTH returns the last day of a month.

=end-start =DATEDIF(start, end, "Y") =EOMONTH(date, 0)

Example: =DATEDIF(H2,$K$6,"Y") returns 8. Full years Dana has worked here as of the report date in K6.

Common mistake: DATEDIF doesn't show up when you start typing it in Excel. It still works. Put the earlier date first, or you get #NUM!.

Practice it: Years of service (pass) · End of hire month (pass) · Days employed (pass) · Months of service (pass)

Ready to try them?

The practice page shows the matching lesson above each exercise, and grades your formula the moment you press Enter.