The Excel LOOKUP function with vector syntax retrieves a value from one range (the result vector) based on a match found in another single-row or single-column range (the lookup vector). It’s ideal when you have one column of unique identifiers (like employee IDs) and another column of corresponding data (like salaries), and you need to pull the correct match without complex nested functions. You must ensure the lookup vector is sorted in ascending order for reliable results, and both vectors must be the same size. No add-ins or special setup are required—just standard Excel data.

What You'll Need

  • Microsoft Excel (any recent version: 2010, 2013, 2016, 2019, 2021, or Microsoft 365)
  • A dataset with at least two columns or rows: one for lookup values (sorted ascending), and one for return values
  • Exact cell references or named ranges for the lookup and result vectors

Step-by-Step

  1. Organize your data so that the lookup values (e.g., product codes, IDs) are in a single column or row, sorted in ascending order (A to Z or smallest to largest). The corresponding return values (e.g., prices, names) must be in the adjacent column or row, in the same order. For example, place IDs in cells A2:A100 and salaries in B2:B100.
  2. Select the cell where you want the result to appear (e.g., D2).
  3. Type the LOOKUP function using vector syntax: =LOOKUP(lookup_value, lookup_vector, result_vector). Replace each argument:
    • lookup_value: The value you want to find (e.g., A2, or a specific value like 1042)
    • lookup_vector: The single-column or single-row range containing the lookup values (e.g., $A$2:$A$100)
    • result_vector: The single-column or single-row range containing the values to return (e.g., $B$2:$B$100)
  4. Press Enter. Excel will search the lookup_vector for the lookup_value. If it finds an exact match, it returns the corresponding value from result_vector. If no exact match exists, it returns the value corresponding to the largest value in lookup_vector that is ≤ lookup_value (so sorting is critical).
  5. Copy the formula down other cells (e.g., drag the fill handle in D2 down to D10) to apply it to multiple rows. Ensure absolute references ($A$2:$A$100) are used in the vector arguments so the ranges don’t shift when copied.
  6. Verify the result by testing with known values. For instance, if ID 1042 appears in A50 with salary $65,000 in B50, entering =LOOKUP(1042, $A$2:$A$100, $B$2:$B$100) should return 65000.

Common Mistakes

  • Unsorted lookup vector: LOOKUP assumes ascending order. If IDs are in random order (e.g., 1001, 1020, 1010), it may return the wrong value—even if an exact match exists—because it stops at the first value greater than the lookup_value.
  • Mismatched vector sizes: If lookup_vector has 50 rows and result_vector has 49, Excel returns #N/A or incorrect data. Always double-check the range endpoints.
  • Using range references with blanks: Empty cells in the lookup_vector can cause #N/A errors or unexpected behavior. Remove blanks or filter them out before applying LOOKUP.
  • Text vs. number mismatches: LOOKUP treats "100" (text) and 100 (number) as different. Ensure the lookup_value and lookup_vector use the same data type (e.g., both numbers).
  • Assuming exact match only: LOOKUP returns the closest match ≤ lookup_value, not necessarily an exact one. Use XLOOKUP or VLOOKUP with FALSE for strict exact-match behavior if needed.

Tips

  • Sort first: Always sort your lookup column in ascending order before using LOOKUP. Use Data > Sort > A to Z (or Smallest to Largest) to guarantee accuracy.
  • Use absolute references: Lock ranges with $ (e.g., $A$2:$A$100) when copying formulas to prevent range drift.
  • Test with edge cases: Try a value smaller than the smallest lookup value (returns #N/A), equal to the largest (returns exact match), and between two values (returns the lower match).
  • Combine with IFERROR: Wrap LOOKUP in IFERROR to handle missing matches gracefully: =IFERROR(LOOKUP(A2, $A$2:$A$100, $B$2:$B$100), "Not found").
  • Prefer vectors for 1D data: LOOKUP with vector syntax is simpler than array syntax when you only need two parallel ranges. For more columns or complex logic, consider INDEX/MATCH or XLOOKUP.

Troubleshooting

If LOOKUP returns #N/A, #REF!, or an unexpected value, follow these checks:

  1. Verify sorting: Select the lookup_vector column and confirm it’s sorted ascending. Unsort it and re-sort if unsure.
  2. Check vector dimensions: Compare the number of cells in lookup_vector and result_vector. Use =ROWS($A$2:$A$100) and =ROWS($B$2:$B$100) to compare—both must match.
  3. Inspect data types: In the lookup_vector, select a cell and look at the formula bar. If a number is left-aligned, it’s text. Use Data > Text to Columns or the VALUE function to convert text numbers to true numbers.
  4. Test with a known exact match: Use a value you know exists (e.g., the first ID in your list) to isolate whether the issue is data-related or formula-related.
  5. Check for hidden spaces: Copy a lookup value, paste it into a new cell, and use TRIM to remove extra spaces: =TRIM(A2). Re-run LOOKUP with TRIMmed values.
  6. Confirm no #N/A in vectors: If any cell in result_vector is #N/A, LOOKUP may propagate it. Use =IFERROR(result_value, "") in the source data to clean errors first.

Frequently Asked Questions

Can LOOKUP handle two criteria (e.g., ID + date)?

No. LOOKUP only supports a single lookup vector. For multiple criteria, combine columns (e.g., =A2&"|"&B2) or use XLOOKUP with a helper column.

What happens if the lookup_value appears more than once?

LOOKUP returns the value corresponding to the last occurrence of the largest value ≤ lookup_value. If duplicates exist, the result depends on sorting order—always ensure unique lookup values for predictable outcomes.

Does LOOKUP work vertically and horizontally?

Yes. For horizontal vectors (e.g., A1:Z1 for lookup, A2:Z2 for results), use row ranges. For vertical vectors (e.g., A2:A100, B2:B100), use column ranges. Both work identically as long as dimensions match.

Is LOOKUP available in Excel Online and mobile apps?

Yes. LOOKUP is a core function supported in Excel for the web, Windows, Mac, iOS, and Android—no version restrictions apply.

Can LOOKUP return text and numbers?

Yes. The result_vector can contain any data type: numbers, text, dates, or formulas. Excel preserves the original formatting and type.

Why does LOOKUP return a value but it’s not exact?

This is expected behavior. LOOKUP performs an approximate match. If your lookup_vector is sorted and contains 100, 200, 300, then LOOKUP(150, ...) returns the value for 100. Use XLOOKUP with match_mode set to 0 for exact-only matches.