Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Google Sheets: Check if a Cell Is Not Empty

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To check if a cell is not empty in Google Sheets, use the formula =IF(A1<>"", "Not empty", "Empty"). The <> operator means "not equal to," and "" represents an empty string. If the cell contains any value—text, number, date, or even a space—the formula returns "Not empty." This works for a single cell or an entire range when combined with functions like COUNTA or SUMPRODUCT.

What You'll Need

  • A Google account and access to Google Sheets (desktop browser or mobile app).
  • A spreadsheet with data, or a blank sheet to test the formulas.
  • Basic familiarity with entering formulas (starting with =).

Step-by-Step

  1. Open your spreadsheet in Google Sheets. The steps below apply to both desktop and mobile; menu labels may differ slightly by version or device, but the formula syntax is identical.
  2. Select an empty cell where you want the result to appear. For example, click cell B1.
  3. Type the basic not-empty formula: =IF(A1<>"", "Not empty", "Empty"). Press Enter. If A1 contains any value, B1 shows "Not empty"; if A1 is blank, B1 shows "Empty."
  4. Test with different content. Type text in A1 (e.g., "Hello"), a number (e.g., 42), or a date. The formula still returns "Not empty." Note that a cell containing only a space is considered not empty because it has a character.
  5. Check an entire range for any non-empty cell. Use =COUNTA(A1:A10)>0. This returns TRUE if at least one cell in A1:A10 has content, FALSE if all are empty. To display custom text, wrap it: =IF(COUNTA(A1:A10)>0, "Has data", "All empty").
  6. Count non-empty cells in a range. Use =COUNTA(A1:A10) to get the number of cells that are not empty. This counts text, numbers, and errors, but not truly blank cells.
  7. Use SUMPRODUCT for a more precise check. If you need to treat cells with only spaces as empty, use =SUMPRODUCT(--(TRIM(A1:A10)<>""))>0. This trims spaces before checking, so a cell with a single space counts as empty.
  8. Apply the formula down a column. If you have data in A1:A10 and want a per-row check in B1:B10, enter the formula in B1 and drag the fill handle (small square at the bottom-right of the cell) down to B10. Relative references adjust automatically.
  9. Combine with other functions. For example, to sum only non-empty cells in B1:B10 where A1:A10 is not empty, use =SUMIF(A1:A10, "<>", B1:B10). The criteria "<>" means "not empty."
  10. Use conditional formatting (optional). To highlight non-empty cells, select the range, go to Format > Conditional formatting, choose "Custom formula is," and enter =A1<>"". Set a fill color and click Done. This visually flags any cell with content.

Common Mistakes

  • Confusing empty with blank. A cell containing a formula that returns "" (empty string) is not truly empty—COUNTA counts it, but ISBLANK returns FALSE. Use ISBLANK(A1) to check for truly empty cells.
  • Forgetting that spaces count. A cell with a single space is not empty. Use TRIM or LEN(TRIM(A1))>0 to ignore whitespace-only cells.
  • Using =A1<>"" without IF. This returns TRUE/FALSE, which is fine, but if you expect text output, wrap it in IF.
  • Mixing up COUNTBLANK and COUNTA. COUNTBLANK counts empty cells, while COUNTA counts non-empty ones. Use the right one for your goal.
  • Dragging formulas without absolute references. If you reference a fixed range like A1:A10, use $A$1:$A$10 to prevent it from shifting when copied.

Tips

  • Use ISBLANK(A1) for a strict empty check (only truly empty cells).
  • To check if any cell in a range is non-empty, =COUNTA(range)>0 is the simplest approach.
  • For dynamic ranges, use COUNTA(A:A) to count non-empty cells in the entire column, but be aware it includes the header.
  • Combine with FILTER to extract non-empty rows: =FILTER(A1:B10, A1:A10<>"").
  • Remember that errors (like #N/A) are considered non-empty by COUNTA.

Troubleshooting

  • Formula returns "Empty" when the cell looks filled. The cell may contain a formula that returns "" or only spaces. Check with =LEN(A1) to see the character count.
  • COUNTA returns 0 but you see data. The data might be in a different range or hidden. Verify the range reference.
  • Conditional formatting not working. Ensure the custom formula uses relative references (e.g., =A1<>"" for range A1:A10) and that the range is selected correctly.
  • Formula shows #NAME? error. Check for typos in function names (e.g., COUNTA not COUNT A).
  • Mobile app behaves differently. Some functions may require manual entry; the formula bar is available in the mobile app, but dragging to fill may be limited.

Frequently Asked Questions

How do I check if a cell is not empty in Google Sheets?

Use =IF(A1<>"", "Not empty", "Empty"). This checks if A1 is not equal to an empty string.

What is the difference between ISBLANK and COUNTA?

ISBLANK returns TRUE only for truly empty cells. COUNTA counts cells that are not empty, including those with formulas returning "".

Can I check if a range has any non-empty cells?

Yes, use =COUNTA(A1:A10)>0. This returns TRUE if at least one cell in the range has content.

How do I ignore cells with only spaces?

Use =SUMPRODUCT(--(TRIM(A1:A10)<>""))>0 or =LEN(TRIM(A1))>0 for a single cell.

Why does my formula return TRUE for a blank cell?

The cell might contain a formula that returns an empty string, or a space. Use =ISBLANK(A1) to check for true emptiness.

Can I use this with conditional formatting?

Yes, select your range, go to Format > Conditional formatting, choose "Custom formula is," and enter =A1<>"".