To apply conditional formatting when a cell is empty in Excel for Microsoft 365, select the cells, then choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. With the first cell of the selection at A2, enter =A2="", choose a format, and confirm. Excel will format cells for which the formula evaluates as empty, including cells whose formulas return an empty string.
Choose the right rule for empty cells
The formula rule is flexible, but it is not always necessary. If you only need to highlight genuinely blank cells, Excel has a built-in rule: select the range and choose Home > Conditional Formatting > Highlight Cells Rules > More Rules, then select Blanks. Depending on the dialog layout, you may also find a Blanks option among the available rule types.
Use the formula method when “empty” has a particular meaning in your worksheet, such as a formula result that looks blank, a cell that contains only spaces, or a blank in one column that should control formatting in another. The distinction matters because a cell can look empty without actually being empty.
- Truly empty cell: No value or formula has been entered.
- Formula returning an empty string: The cell contains a formula, often one that returns
"", so it appears blank. - Space or other invisible character: The cell contains text, even if it is difficult to see.
Set up a formula-based rule
In a conditional-formatting formula, write the test as if it were being evaluated for the top-left cell of the selected range. Excel adjusts relative references for the other cells in that range. For example, with cells A2:A20 selected, use =A2="". The formula is true for each row where the corresponding cell in column A is blank or returns an empty string.
- Select the cells that should receive formatting, such as A2:A20.
- Go to Home > Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format.
- Enter the formula, starting with an equals sign, and choose Format to set a fill, font, border, or other available appearance.
- Select OK to create the rule, then check the range and formula in Conditional Formatting Rules Manager if the result is unexpected.
Keep the reference relative when each row should test its own cell: =A2="". If you are applying a rule to several columns but want every cell in a row to depend on column A, lock the column but not the row. With A2:D20 selected, use =$A2=""; this highlights the cells across a row whenever its A cell is empty. The dollar sign fixes the column reference while the row number adjusts.
Understand the formulas and their differences
The test =A2="" is often the most useful general-purpose condition for a visually empty cell. In a conditional-formatting formula, it returns TRUE when A2 is genuinely blank or its formula result is an empty string. For a rule that must detect only a cell with no contents at all, use =ISBLANK(A2). ISBLANK returns TRUE for a truly empty cell, but not for a cell containing a formula that displays an empty string.
For instance, suppose A2 contains =IF(B2=0,"",B2). When B2 is zero, A2 displays nothing. The condition =A2="" treats that displayed result as empty, while =ISBLANK(A2) does not, because A2 still contains a formula. Choose based on what the formatting should communicate: a missing entry, or a cell that has no underlying content.
To treat a cell containing only ordinary leading or trailing spaces as empty, use =TRIM(A2)="". TRIM removes ordinary spaces at the beginning and end of text and reduces repeated internal spaces. It does not remove every possible invisible character; for example, data imported from websites may include nonbreaking spaces. If the source is messy, clean the data or test for the specific character rather than assuming TRIM catches all whitespace.
Highlight another cell or an entire row
Conditional formatting does not have to color the cell being checked. To highlight B2:B20 when the corresponding A cell is empty, select B2:B20 and use =$A2="". The fixed A column keeps the test in column A, while the relative row makes each selected row check its own A cell.
To highlight an entire record, select A2:D20 and enter the same condition, =$A2="". Excel evaluates the formula from the top-left of the selected range and applies the resulting format to each cell covered by the rule. Make sure the row number in the formula matches the first row in the selection: if the selection begins at row 5, the formula should reference row 5, not row 2.
This setup is useful for incomplete forms or task lists. For example, if column A contains an employee name and columns B through D contain assignment details, a row-based rule can flag records whose name is missing. If the required field is in column D instead, change the locked column reference to D.
Common problems and how to fix them
- The wrong rows are highlighted: Check that the formula’s row number matches the first row in Applies to. Also check whether the column should be locked with a dollar sign.
- Cells that look blank are not formatted: They may contain spaces or another invisible character. Try a TRIM-based condition for ordinary spaces, or inspect and clean imported data.
- A formula cell is highlighted unexpectedly: If the formula returns
"", then=A2=""will treat its displayed result as empty. Use=ISBLANK(A2)if only physically empty cells should match. - Formatting appears inconsistent: Open Home > Conditional Formatting > Manage Rules and inspect the Applies to range, formula, and other rules affecting the same cells. Rules can overlap, and rule order or Stop If True settings may affect which format is visible.
- The rule was created for the wrong range: Select the intended cells before creating the rule, or correct Applies to in Rules Manager.
Conditional formatting changes appearance; it does not delete values or convert formulas into blank cells. A colored cell remains unchanged unless you edit its contents separately. This makes the feature suitable for flagging missing information without altering the worksheet’s data.
Manage and adapt the rule
To revise an existing rule, select a cell in its range and choose Home > Conditional Formatting > Manage Rules. The Rules Manager lets you edit the formula, change the format, adjust Applies to, delete a rule, or review other rules that affect the selection. If the rule is not listed, change the Show formatting rules for menu to the relevant worksheet or current selection.
On Excel for Mac, the conditional-formatting commands are also on the Home tab; select the range and use Conditional Formatting to create or manage a rule. Excel for the web supports conditional formatting as well, though the dialog and some management options can differ from the Windows desktop version. In any version, confirm that the rule applies to the intended range and that the relative references align with its first row.
For a repeated worksheet pattern, you can copy formatting with Format Painter or use Paste Special to paste formats, but review the rule range afterward. Copying cells can also copy or adjust conditional-formatting rules, so it is worth checking Rules Manager when a workbook develops duplicate or overlapping rules.
Frequently Asked Questions
What formula highlights blank cells in Excel?
For a range beginning at A2, use =A2="" in a formula-based conditional-formatting rule. For genuinely empty cells only, use =ISBLANK(A2).
Does conditional formatting treat a formula result of “” as blank?
Yes, the comparison =A2="" matches a formula result that is an empty string. ISBLANK does not, because the cell still contains a formula.
How do I highlight a row when one cell is empty?
Select the rows or columns to format, then test the required column with a locked reference. For a range beginning on row 2 where column A controls the rule, use =$A2="".
How can I format a blank cell without a formula?
Select the range and choose Home > Conditional Formatting > Highlight Cells Rules > More Rules, then choose the blanks rule if available. Alternatively, create a formula rule using =ISBLANK(A2), with A2 replaced by the selection’s top-left cell.
Why is a cell that looks empty not being highlighted?
It may contain spaces, a nonprinting character, or another value. Use a TRIM-based test for ordinary spaces, and inspect or clean imported data when invisible characters may be present.
Related
- Google Sheets Conditional Formatting With IF
- Excel Conditional Formatting for Errors
- Google Sheets Conditional Formatting for Full Rows
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Split Function in Groovy: How to Use ItThe split() function in Groovy is a method on String that divides the string into an array of…
- Attendance Calculation in Excel: Formulas and ExamplesTo calculate attendance in Excel, divide the number of sessions marked present by the number of sessions with…
- Excel Day of Week from Date: Formulas and FormattingIf your date is in A2, enter =TEXT(A2,"dddd") to show its full weekday name; for example, an actual…
- Excel Scenario Manager Examples for What-If AnalysisExcel Scenario Manager examples include comparing low, expected, and high sales forecasts, testing different staffing plans, or checking…
- Round Pedestal Table: Pros, Cons & Buying GuideA round pedestal table is a dining or occasional table supported by a single central column (the pedestal)…
- Compare Two Lists in Excel to Find Unique ValuesTo find values in one Excel list that are missing from another, use FILTER with XMATCH; wrap the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.