Pairing LOOKUP with IF is one of the most common combinations in Google Sheets. On its own, LOOKUP either finds a match or returns an error; you almost never want a raw #N/A bleeding into a customer-facing dashboard. Wrapping the lookup in IF lets you decide what happens when the search key is missing, when the result is blank, or when you want to apply a rule on top of the matched value.

Why combine LOOKUP with IF

A bare LOOKUP call returns the first match it finds, or an error if nothing matches. That is fine when you fully trust the input column, but in real spreadsheets the lookup key is usually typed by a human, pulled from a form, or imported from another tab. IF gives you a place to handle the edge cases: substitute a friendly fallback, suppress a divide-by-zero downstream, or branch into a different calculation when the match comes back empty. The combination keeps the rest of your sheet calm even when the source data is messy.

The full pattern

=IF(ISNA(LOOKUP(A2, Lookup!A:C, 3, FALSE)), "Not found", LOOKUP(A2, Lookup!A:C, 3, FALSE))

Read it from the inside out: LOOKUP performs the actual search, ISNA reports whether that search failed, and IF chooses between a fallback string and the real result. In modern Google Sheets you would normally collapse the whole thing into =IFNA(LOOKUP(...), "Not found"), but the explicit IF version is worth knowing because it generalizes — you can swap ISNA for any test you like, including ISBLANK, comparisons against thresholds, or category checks against another lookup.

Worked example: order status dashboard

Imagine an Orders sheet with order IDs in column A and a Customers sheet that maps each order ID to a customer name in column B and a tier in column C. You want to show Customer (Tier) in your dashboard, but show "Guest checkout" when there is no matching customer record. The formula =IF(ISNA(LOOKUP(A2, Customers!A:C, 2, FALSE)), "Guest checkout", LOOKUP(A2, Customers!A:C, 2, FALSE) & " (" & LOOKUP(A2, Customers!A:C, 3, FALSE) & ")") handles both branches in a single cell and remains readable when you come back to it three months later.

Variant: scoring rules on top of the match

Sometimes the lookup is just the input to a richer decision. If you are pricing a product based on a tier code, you can nest LOOKUP inside an IF test: =IF(LOOKUP(A2, Tiers!A:B, 2, FALSE) > 100, "Premium", "Standard"). The lookup stays focused on returning a single number, and the conditional layer expresses the business rule. Splitting concerns this way makes each piece easier to debug than one heroic mega-formula.

Worked examples

Friendly fallback for a missing key

=IFERROR(LOOKUP(B2, Pricing!A:C, 3, FALSE), "Contact sales")

IFERROR catches every error, not just #N/A — handy if the lookup table itself might break.

Branch on the looked-up value

=IF(LOOKUP(B2, Inventory!A:D, 4, FALSE) <= 0, "Backorder", "Ship now")

The lookup runs first, then IF compares the result to zero. Wrap the inner call in IFERROR if missing SKUs are realistic.

Apply two different lookups depending on a flag

=IF(C2="INTL", LOOKUP(B2, IntlRates!A:B, 2, FALSE), LOOKUP(B2, DomesticRates!A:B, 2, FALSE))

A single LOOKUP call cannot pick its own table; IF lets you route to the right one.

Common mistakes (and how to avoid them)

  • Forgetting the FALSE at the end of LOOKUP. Without it, Sheets assumes a sorted lookup and quietly returns the wrong row.
  • Wrapping the wrong call. IFERROR(IF(LOOKUP(...))) hides errors inside the IF rather than at the lookup itself.
  • Using LOOKUP on a column that has trailing spaces. Run the lookup column through TRIM or fix it at the source — silent mismatches waste hours.
  • Mixing data types: the search key is a number stored as text. Coerce with VALUE(A2) or build the lookup column the same way.

Tips that pay off later

  • Consider IFNA instead of IFERROR when you want to surface real syntax errors but hide "no match found".
  • If the lookup table lives in another file, swap to IMPORTRANGE wrapped in QUERY for better performance than LOOKUP across files.
  • Wrap repeated lookups in a LET binding to evaluate once and reuse — both faster and easier to read.

When to reach for something else

If you find yourself nesting more than two conditionals around a single LOOKUP, switch to IFS or SWITCH for legibility, or move the table-of-rules into a small helper sheet and look it up directly.

Functions used in this tutorial