Instant digital downloadExcel and Google SheetsSecure card checkout

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.

ABCD
1OrderEmailPaidStatus
21001ana@example.com25Paid
31002ben@example.comRemind
4100340Paid
51004Remind
61005eli@example.com15Paid

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.

Teaching this to a class or team?

Get one tip like this a month

A free email from VARS Digital with one Excel or Google Sheets fix, tested in both apps. No spam, unsubscribe any time.

By signing up you agree that VARS Digital, 10151 240 Street, Maple Ridge, BC V2W 0G9, Canada (inquiries@varsdigital.app) may email you its newsletter: Excel and Google Sheets tips, updates and news about our templates and lessons. We send a confirmation email first, and nothing else goes out until you click it. Every email has an unsubscribe link, and you can leave any time. Details in our store policies.

More how-tos