Excel and Google Sheets how-to
IF a cell is blank, or not blank
You want a formula to do one thing when a cell is empty and something else when it is filled. Two double quotes do the job, and they also catch the blanks ISBLANK misses.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Paid | Status | |
| 2 | 1001 | ana@example.com | 25 | Paid |
| 3 | 1002 | ben@example.com | Remind | |
| 4 | 1003 | 40 | Paid | |
| 5 | 1004 | Remind | ||
| 6 | 1005 | eli@example.com | 15 | Paid |
Sample data. Column C stays empty until the customer pays. D2 holds =IF(C2="","Remind","Paid"), filled down to row 6.
The formula
Column C holds what each customer paid and stays empty until they pay. Click D2 and type:
=IF(C2="","Remind","Paid")D2 shows Paid. Fill it down and orders 1002 and 1004 show Remind.
- C2="" asks whether C2 is empty. Two double quotes with nothing between them mean empty text.
- "Remind" is what shows when it is empty.
- "Paid" is what shows when anything is in it.
Not blank: only work it out when there is a number
Flip the test with <>, which means "not equal to":
=IF(C2<>"","Paid","Remind")That gives the same answers. The more useful version keeps a cell empty until there is something to work with. To add 13% tax only where an amount is there:
=IF(C2="","",C2*1.13)Order 1001 shows 28.25, 1003 shows 45.2 and 1005 shows 16.95. The unpaid rows stay empty instead of showing 0.
Why ISBLANK says FALSE for a cell that looks empty
=ISBLANK(C3) gives TRUE, because nothing was ever typed in C3. Now put the tax formula above in column F and point ISBLANK at F3, the tax cell for order 1002. =ISBLANK(F3) gives FALSE, even though F3 looks empty. F3 holds a formula, and the "" it returns is empty text, not an empty cell.
Both apps say so in their help pages: Microsoft says ISBLANK is TRUE only when the cell it points at is empty, and Google says it is FALSE for any content, spaces and the empty string included. =F3="" gives TRUE, so ="" is the safer test in most sheets. It is TRUE for an empty cell and for a formula that shows nothing.
A cell that looks empty but holds a space
A space you cannot see beats both tests. If H2 holds one space, =H2="" gives FALSE and =ISBLANK(H2) gives FALSE, so =IF(H2="","Remind","Paid") says Paid for a cell with nothing in it you can read. Wrap the cell in TRIM, which takes the spaces off, and LEN, which counts what is left:
=IF(LEN(TRIM(C2))=0,"Remind","Paid")LEN(TRIM(C2))=0 is TRUE for an empty cell, a formula that shows nothing and a cell of spaces, so the space cell now says Remind. To find the space-only cells so you can clear them, put this next to the column and look for TRUE:
=AND(LEN(C2)>0,LEN(TRIM(C2))=0)It is TRUE for a cell of spaces and FALSE for an empty cell, a formula blank or a real entry. Click each cell that has TRUE next to it and press Delete.
One more thing that is not blank: a 0. =H3="" gives FALSE when H3 holds 0, so a zero counts as filled.
Two cells: both blank, or either one
Order 1004 has no email and no payment. To flag rows where both are empty:
=IF(AND(B2="",C2=""),"Check order","")Only 1004 shows Check order. A shorter test for the same thing is =COUNTBLANK(B5:C5)=2, which gives TRUE when both cells are empty. It scales to longer rows too: =COUNTBLANK(B2:F2)=5 is TRUE only when all five cells are empty.
To flag a row where either one is missing, use OR:
=IF(OR(B2="",C2=""),"Missing","Complete")Orders 1002, 1003 and 1004 show Missing; 1001 and 1005 show Complete.
Count the blanks
How many orders are not paid yet:
=COUNTBLANK(C2:C6)gives 2. =COUNTA(C2:C6) gives 3, the cells with anything in them, and =COUNTIF(D2:D6,"Remind") also gives 2.
Formula blanks count differently in each one. In the tax column F, =COUNTBLANK(F2:F6) gives 2, but =COUNTA(F2:F6) gives 5, because COUNTA counts every cell with a formula in it, even one that shows nothing. Microsoft's and Google's help pages both say so. To count the filled ones in a column like that:
=ROWS(F2:F6)-COUNTBLANK(F2:F6)gives 3. COUNTBLANK does not count a cell that holds a space or a 0.
Free practice sheet
Try it on three everyday jobs: who still has to pay, cells that only look empty because they hold spaces, and counting blanks in a column of formulas. Each tab has yellow cells to fill in and a Check column that says Correct or Try again as you type, plus an Answers tab. One Excel file that opens in Google Sheets too. Free, no sign up. Sample data.
Download the practice sheet (.xlsx, 11 KB)
Watch it in 23 seconds
Templates with the math already done
Rather skip the formulas? These templates come with every formula built and checked, plus a filled-in sample.
- Invoice Template and TrackerInvoices with a payment tracker for paid and overdue.
- Bill TrackerMonthly, quarterly and yearly bills on one checklist, with overdue flags and paid against due by month.
- Teacher GradebookOne class of up to 40 students: type the scores and see the overall percent, letter grade and missing work.
Teaching this to a class or team?
More how-tos
- Find a price by its code with XLOOKUPType a product code, get its price back from your price list. One formula, no helper columns.
- Total each category with SUMIFSAdd up all the Fuel, all the Office, all the Meals: one formula per category, and more rules when you need them.
- Check two conditions at once with IF and ANDFree shipping only when the order is 50 or more and ships in Canada: one IF, one AND, done.
- Add leading zeros to numbersType 00021 and Excel or Google Sheets shows 21, because to them it is just the number 21. Here is how to get the zeros back, and keep them.
- Fix #DIV/0! in an averageAn average of nothing is a division by zero, so AVERAGE shows #DIV/0! until the first number arrives. One IF fixes it.
- Count rows that meet two conditions with COUNTIFSHow many of Ana's deals were 500 or more? COUNTIFS answers it in one cell, and takes as many rules as you need.
- Calculate percentage changeSales went from 400 to 500. That is a 25% increase, and one short formula works it out for every row.
- Calculate years of service from a start dateAna started on 15 March 2019. How many full years has she worked? DATEDIF counts them, and the same formula works out an age from a date of birth.
- Combine first and last name into one cellFirst names in one column, last names in the next, and you need "Ana Lopez" in one cell. The & sign joins them.
- Find duplicates in a list with COUNTIFA mailing list where some people signed up twice. One formula shows how many times each email appears, so the repeats stand out.
- Split a full name into first and last nameYour list has "Ana Lopez" in one cell and you need Ana and Lopez in two. Two short formulas find the space and split there.
- Total amounts by month with SUMIFSA list of dated expenses and you want one total per month. SUMIFS adds every amount between the first and the last day of the month.
- Count working days between two datesAna is off from 1 Oct to 14 Oct. How many working days is that? NETWORKDAYS counts Monday to Friday and leaves out the weekends.
- Hide #N/A in VLOOKUP with IFERRORYour order list has a code that is not in the price list, and VLOOKUP shows #N/A. IFERROR puts your own words there instead.
- Count cells that contain textA stock list where some items have a note and most do not. One COUNTIF with an asterisk counts the notes and skips the empty cells.
- Make a running total (cumulative sum)Monthly sales in one column, the total so far in the next. One formula, filled down.
- Round to 2 decimal places, up or downA 15% discount turns 12.99 into 11.0415. ROUND makes it 11.04 and keeps your totals right to the cent. ROUNDUP and ROUNDDOWN handle the times when nearest is the wrong answer.
- How long to $1,000,000? FV and NPERPut $500 a month away at an example 7% a year. FV says what it grows to, NPER says when it passes $1,000,000. Two formulas, no calculator site.
- Why your formula gives the wrong number: the order of operationsA2 holds 10 and A3 holds 4. What does =A2-A3*2 give? It is 2, not 12. The same rule explains most formulas that look right and give the wrong number.
- Why your SUM says 0, and how to fix itThe amounts are right there in the column, and the total says 0. They look like numbers, but the sheet has them stored as text, and SUM skips text.
- Fill handle not working? Copy a formula down fastYou wrote one formula and need it in every row. Here are the quick ways to copy it down, and what to check when the fill handle will not show up or the copies come out wrong.
- Calculate hours worked from start and end timesA shift from 9:00 to 17:30 is 8.5 hours, but subtract the times and the cell shows 8:30. One small change turns it into a number you can add up and multiply by a pay rate.
- Formulas not updating? Recalculate and refreshYou change a number and the total does not move. It is nearly always one of a handful of things, and each one takes seconds to fix once you know which.
- Standard deviation in Excel and Google SheetsTwo shops both average 40 orders a day. One sells 38 to 42 every day; the other swings from 25 to 55. The average cannot tell them apart. The standard deviation can.
- Stack several columns into one column with TOCOLNames in three columns, one for each day, and you need them in one list. One formula does it, and the list keeps up when the columns change.
- Long numbers turn into E+ or end in 0 in ExcelYou type a 12 digit order number and Excel shows 5.93774E+11. You type a 16 digit account number and the last digit turns into 0. The first one is only how the cell looks. The second is a real loss, and it has to be stopped before you type.
- Count how many times each value appears in a columnA staff list with a department on every row, and you need to know how many people are in each department. Two short formulas build the count table, and it keeps up when the list changes.
- Free pricing calculatorsPrice a job from your real costs and margin. No sign up.
- Free downloadsPractice sheets and printable pages, no email and no sign up.







