Sub topic 12
Fixing #NULL!: incorrect range operators
This chapter assumes you can enter and edit formulas, use cell references and ranges such as A2 and A2:A10, and use basic functions such as SUM. By the end, you should be able to recognize a #NULL! error, find the operator that caused it, and correct the formula.
What #NULL! means
Excel returns #NULL! when a formula uses the intersection operator and the two ranges it joins do not overlap. The intersection operator is a single space between two references. It returns only the cells that both references share.
Most people never mean to use it. They type a space where they wanted a comma or a colon, and Excel quietly treats the space as an instruction.
Reproducing the error
Suppose you want to add two separate blocks of cells, A1:A5 and C1:C5. This formula looks reasonable:
=SUM(A1:A5 C1:C5)The space between the two ranges is the intersection operator. Column A and column C share no cells, so the intersection is empty and Excel returns #NULL!.
The corrected formula separates the ranges with a comma:
=SUM(A1:A5,C1:C5)The comma is the union operator in a function argument list. Each range becomes its own argument, and SUM adds all ten cells.
The three range operators
Three operators join references. Mixing them up is the cause of nearly every #NULL! error.
| Operator | Symbol | Meaning | Example |
|---|---|---|---|
| Range | : (colon) | Every cell between two corners | A1:A5 |
| Union | , (comma) | Combines separate references | A1:A5,C1:C5 |
| Intersection | (space) | Only the cells the references share | A1:C5 B3:D8 |
The separator in your formulas may differ by region. Some language settings use a semicolon instead of a comma as the argument separator. Check the examples Excel shows in its function tooltips if a comma is rejected.
Common causes
- A space instead of a comma. This is the case shown above. It often happens when you type a list of ranges quickly.
- A missing colon in a range. Writing
=SUM(A1 A5)instead of=SUM(A1:A5)asks for the intersection of two single cells. Those cells differ, so the result is #NULL!. - A stray space inside a reference. A typo such as
A1: A5is normally accepted, but a space placed between two references, as inB2 B3, creates an intersection. - Ranges that really should overlap but do not. If you use intersection on purpose, a range that moved or was resized can leave no shared cells.
A step-by-step fix
- Select the cell that shows #NULL!.
- Look at the formula bar and find every place where two references are separated by a space.
- Decide what you intended. If you wanted both ranges, replace the space with a comma. If you wanted one continuous block, replace the space with a colon.
- Press Enter and check that the result is a number.
- Confirm the total is plausible, for example by adding a few cells by hand.
When intersection is intentional
The intersection operator is useful with named ranges. If a sheet has a named row called Sales and a named column called March, this formula returns the single cell where they cross:
=Sales MarchIf the two names do not cross, the result is again #NULL!. In this case the error is correct. It tells you the names point to areas that do not meet, so check the definitions in Name Manager.
Diagram of the decision
Exercises
Exercise
A colleague's formula =SUM(B2:B10 D2:D10) returns #NULL!. Explain why, and write the corrected formula that adds both ranges.
Show answer
The space between B2:B10 and D2:D10 is the intersection operator. Columns B and D share no cells, so the result is empty and Excel shows #NULL!. The corrected formula is =SUM(B2:B10,D2:D10).
Exercise
You write =SUM(A1 A5) to add the five cells from A1 to A5 and get #NULL!. What is wrong, and how do you fix it?
Show answer
The formula is missing the colon. The space asks for the intersection of the single cells A1 and A5, which do not overlap. Use =SUM(A1:A5).