Smart Systems for Home

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

Return Null in Excel: How to Create Empty Cells

· 6 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 return a null or truly empty value in Excel, you must use an empty string ("") within a formula, as Excel does not have a native "NULL" keyword like SQL. By using double quotes with nothing between them, you tell Excel to display nothing in the cell, which effectively mimics a null value for visual and reporting purposes. This is most commonly achieved using the IF function to specify that if a certain condition is met, the cell should remain blank.

What You'll Need

  • A computer with Microsoft Excel installed (works across Windows, macOS, and web versions).
  • A dataset containing values that need to be filtered, cleaned, or conditionally hidden.
  • Basic familiarity with entering formulas into the formula bar.

Step-by-Step

  1. Identify the Condition: Determine exactly when you want the cell to appear empty. For example, you might want a cell to be null if the source cell is empty, or if a calculation results in a zero that you do not want to display.
  2. Select the Target Cell: Click on the cell where you want the result to appear. This is typically a helper column next to your raw data.
  3. Start the IF Function: Type =IF( into the cell. The IF function is the primary tool for returning conditional nulls.
  4. Define the Logical Test: Enter the criteria that triggers the null. If you want to check if cell A2 is empty, type A2="". Your formula now looks like =IF(A2="",.
  5. Insert the Null Value: Immediately after the first comma, type two double quotes with no space between them: "". This represents the "value if true." In Excel terms, this is an empty string.
  6. Define the Alternative Value: Add another comma and enter what should happen if the condition is not met. For example, if you want the cell to show the value of A2 if it is not empty, type A2.
  7. Close the Formula: Type the closing parenthesis ) and press Enter. The complete formula would be =IF(A2="", "", A2).
  8. Apply to the Dataset: Hover your mouse over the bottom-right corner of the cell until a small black cross (the fill handle) appears. Click and drag this handle down to apply the null-return logic to the rest of your column.
  9. Verify the Result: Look at the cells. Those that met the condition should now appear completely blank, while those that didn't should display their intended data.

Common Mistakes

One of the most frequent errors is adding a space between the double quotes (" "). While this looks empty to the human eye, Excel treats a space as a character. This means the cell is no longer null; it contains a text string of one space. This will break formulas like COUNTBLANK or ISBLANK, as the cell is technically not empty.

Another common mistake is confusing a null return with a zero. By default, if you leave the "value if false" argument blank in an IF statement, Excel will return the word "FALSE" or a zero. To ensure a clean look, you must explicitly define both the true and false outcomes using the "" syntax.

Users also often try to use the word NULL without quotes. Because NULL is not a reserved function or named range in Excel, this will result in a #NAME? error. Excel does not recognize SQL-style nulls; it only recognizes empty strings or truly blank cells that contain no formula at all.

Tips

If you are dealing with errors like #N/A or #VALUE! and want those to return as nulls, use the IFERROR function instead of a standard IF. The syntax is =IFERROR(your_formula, ""). This is much cleaner than nesting multiple IF statements to catch every possible error type.

For those who want cells to look null without actually changing the data via formulas, you can use Custom Number Formatting. Right-click the cell, select Format Cells > Number > Custom, and enter 0;-0;;@. The third position in this code (between the second and third semicolons) controls how zeros are displayed. By leaving it blank, all zeros in that range will become invisible, effectively appearing as nulls while remaining numbers for calculation purposes.

When working with large datasets, remember that a formula returning "" is still a formula. If you need the cells to be truly empty (for exporting to a CSV or importing into a database that requires absolute nulls), you should copy the range and use Paste Special > Values. Then, use the Find and Replace tool (Ctrl+H) to find nothing and replace with nothing, or use the Go To Special > Blanks feature to select and clear those cells.

Troubleshooting

If your formula is returning 0 instead of a blank cell, check your IF statement. This usually happens when you reference another cell that is empty. For example, if your formula is =A2 and A2 is empty, Excel often displays 0. To fix this, wrap it in an IF: =IF(A2="", "", A2).

If the cell still looks like it has something in it, check for hidden characters or non-breaking spaces. You can test this by using the LEN function in a side cell: =LEN(B2). If the result is 1 or higher, the cell is not null. You may need to use the TRIM or CLEAN functions to remove invisible whitespace before applying your null logic.

If you see #VALUE!, ensure that you haven't accidentally placed a space inside your quotes or used a semicolon where your region's Excel settings require a comma. Regional settings can change the delimiter used in formulas; if you are in Europe, you might need to use =IF(A2=""; ""; A2).

Frequently Asked Questions

Is there a difference between a blank cell and a null return?

Yes. A truly blank cell has no content and no formula. A null return using "" is a zero-length string. While they look the same, ISBLANK() will return TRUE for a truly blank cell but FALSE for a cell containing a formula that returns "".

How do I count cells that are returned as null?

Since COUNTBLANK counts both truly empty cells and those with "" formulas, it is usually the best choice. If you need to be more specific, you can use COUNTIF(range, "") to count only the cells that result in an empty string.

Can I return a null value using a VLOOKUP?

Yes. If a VLOOKUP finds a match but the corresponding value cell is empty, Excel returns 0. To prevent this, wrap the VLOOKUP in an IF statement: =IF(VLOOKUP(...)="", "", VLOOKUP(...)).

Why does my "null" cell still count as a value in a Pivot Table?

Pivot Tables treat zero-length strings as values. To avoid this, you may need to filter out those blanks in the Pivot Table field settings or use the Find and Replace method to convert formula-blanks into actual empty cells before creating the Pivot Table.

Can I use the IFERROR function to return null?

Yes, =IFERROR(formula, "") is the most efficient way to ensure that any calculation that would normally result in an error (like dividing by zero) returns a visually null cell instead.