Spreadsheet Practice

How to use another cell's value if a cell is blank in Excel

Formula (Excel and Google Sheets)

=IF(C2="",B2,C2)

Test the cell and fall back to the other one: =IF(C2="",B2,C2).

Result on the example
one result per row in D2, filled down to D6
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in D2, filled down to D6. Change any input and the result updates, or edit the formula to experiment.

How it works

When the shipping city is empty, IF returns the billing city; otherwise it keeps the shipping city. It is the spreadsheet version of "use this, or fall back to that".

=IF(C2="",B2,C2)

Result"Austin"

  1. C2(empty)

    The value in C2.

  2. C2=""TRUE

    The = operator tests whether the two sides are equal.

  3. B2"Austin"

    The value in B2.

  4. IF(C2="",B2,C2)"Austin"

    IF: Returns one value if a test is true, another if false.

    • logical_testC2=""TRUE
    • value_if_trueB2"Austin"
    • value_if_falseC2(empty)not used

In Google Sheets

The same formula works in Google Sheets: =IF(C2="",B2,C2). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(C2<>"",C2,B2)Austin, Boulder, Tampa…The same rule, testing for a value first.
=IF(LEN(TRIM(C2))=0,B2,C2)Austin, Boulder, Tampa…Also treats a cell that holds only spaces as empty.

Common mistakes

  • A cell holding a space isn't empty, so the fallback doesn't kick in and the result looks blank. The TRIM version handles it.
  • Returning a blank cell directly (=C2) shows 0 in Excel, which is why the blank test comes first.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Use another cell's value if a cell is blank

In D2, show the shipping city, or the billing city when the shipping city is empty. Fill down to D6.

Questions

How do I take the first filled cell of several?

Chain the tests, =IF(C2<>"",C2,IF(B2<>"",B2,"No city")), or in Excel 365 use =XLOOKUP(TRUE,B2:C2<>"",B2:C2,"").

How do I fill blanks with the value above?

In a helper column B: =IF(A2="",B1,A2), filled down, repeats the last value.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.