FormulaGenius
Lookup

Lookup with Conditions

Perform lookups that include conditional logic — look up different values or in different ranges based on conditions. Combines the power of IF with lookup functions.

Excel Formula

=IF(C2="Excel", VLOOKUP(A2, ExcelData, 2, FALSE), VLOOKUP(A2, SheetsData, 2, FALSE))

Step-by-Step Explanation

1

IF checks a condition first

2

Based on the condition, it performs different lookups

3

Can look up in different ranges, columns, or tables

4

Useful when data source varies by type or category

5

Can be nested for multiple conditions

Example

Product (A)Region (B)Price Source (C)Price (D)
WidgetNorthRetail$25.00
WidgetSouthWholesale$18.00
GadgetNorthRetail$40.00

Result: Different price lookup based on Retail vs Wholesale source

Common Variations

XLOOKUP with IF

=XLOOKUP(IF(C2="A",D2,E2),A:A,B:B)

Dynamic search value

IFS with lookups

=IFS(C2="A",VLOOKUP(A2,X:Y,2,0),C2="B",VLOOKUP(A2,X:Z,3,0))

Multiple condition branches

Need a Custom Version?

Use our AI generator to create a formula tailored to your specific data and requirements.

Try It with AI →

Related Templates