Excel Lookup for a Value Meeting Three Conditions: Multi-Condition Formulas

Explain the several ways to write formulas in Excel that look up a value by three criteria, including the newer functions, the general array-formula approach, and the helper-column method. Also cover the basis for choosing each, the operating steps, and how to verify the results.

Key Points of This Article

  • A three-condition lookup can combine the conditions into an array by using multiplication, and works together with XLOOKUP or INDEX plus MATCH.
  • Excel 365 and 2021 can use array conditions directly; older versions require confirming the formula with Ctrl+Shift+Enter.
  • When you do not want to use an array formula, you can add a column to the data table that concatenates the three conditions into one key, and then perform an ordinary lookup.
  • Before looking up, use COUNTIFS to count the matching rows; if the count is greater than 1, there are duplicate records that must be handled first.
  • Spaces in text, full-width characters, and mixing of "numbers and text" are common reasons why three-condition lookups fail.

Many people using VLOOKUP in Excel to find a value find that it works fine with one condition, but once they need to match three conditions at once (region, product, and quarter), they don't know how to write the formula. A common situation is a sales table with several hundred rows, where they need to find the amount for "East China, mobile phones, Q2", and the result is either the wrong row or a #N/A error.

This article is written for office staff, finance personnel, and data organizers who need to locate data based on multiple criteria. After reading it, you will be able to choose the right approach based on your Excel version, write a three-condition lookup formula, and learn how to verify whether the results are correct.

The lookup approach that works for two conditions applies equally to three; the difference is that with more conditions, the formula must combine all of them in one judgment. The following covers, in order, "which form to choose," "how to do it," and "how to verify."

How do I write a formula when three conditions must match at the same time? One-sentence conclusion

The direct answer is: in Excel 365 or 2021, prefer XLOOKUP combined with array conditions; in older versions, use INDEX with MATCH; if you don't want to write array formulas, use a helper column that concatenates the key fields. Which one to choose depends mainly on your Excel version and the size of your data.

Your situationRecommended PracticesCause
Excel 365 or 2021, just one resultXLOOKUP with Array ConditionsA formula completes with a single Enter press, with no need for Ctrl+Shift+Enter, and you can directly specify the prompt text to show when nothing is found.
Older versions of Excel: a universal (compatible) formula approach is neededINDEX plus MATCH, array conditionsAll versions support it, but you need to confirm with Ctrl+Shift+Enter.
I want people to understand the data source at a glanceConcatenate keywords in a helper column, then use a regular searchEvery step shows its intermediate results, making it easy to verify and debug.
The same set of conditions may correspond to multiple rows.FILTER to list all results, or SUMIFS to sumA standard lookup only returns the first match, so when there are multiple rows you need to switch to a list or aggregate function.

Before You Begin: Confirm These Points

Before you start, check the following items. They can save you most of the time spent troubleshooting.

  • Confirm your Excel version. You can check the version information on the Account or About page in Excel. If XLOOKUP and FILTER are available, you can write array conditions directly; if not, use INDEX with MATCH and confirm with Ctrl+Shift+Enter.
  • Confirm the columns containing the three conditions. The three conditions and the result must be in the same table and the same rows, with matching range sizes. For example, if the conditions are in columns A, B, and C and the result is in column D, all four must have the same number of rows; otherwise the formula will return an error.
  • Confirm the data is clean. Leading or trailing spaces, full-width and half-width characters, and numbers stored as text can all cause values that "look the same" to fail to match. You can check the length with the LEN function or clean the values with TRIM.
  • Confirm whether there are duplicate records. If the same region, product, and quarter appear in multiple rows, a standard lookup will only return the first match, which may not be what you want. Count the rows first before deciding how to write the formula.
  • Confirm the table's source. If the data comes from a table in a PDF, you can first export the PDF to Excel using the OmniDoc desktop client (download address: download.omnidoc.top), and then perform the lookup. After exporting, you still need to check that the numbers and text match the original.

Steps for a three-condition lookup in Excel

Using a sales table as an example. Column A is the region, column B is the product, column C is the quarter, and column D is the amount, with data from row 2 to row 200. We want to enter three criteria in column G and get the corresponding amount in cell J2.

  1. Enter the region, product, and quarter you want to look up in G2, H2, and I2, for example "East China", "Mobile phone", and "Q2". The entries must match the spelling in the table exactly.
  2. Enter the formula for the new version in J2: XLOOKUP(1, (A2:A200=G2)(B2:B200=H2)(C2:C200=I2), D2:D200, "Not found"). The multiplication sign makes the result 1 only when all three conditions are met at the same time, and 0 otherwise.
  3. Press Enter to confirm. Excel 365 and 2021 handle the array automatically, so no extra steps are needed. If "Not found" is returned, there is no fully matching row; go back to step 4 and check the data.
  4. Older versions of Excel can use INDEX(D2:D200, MATCH(1, (A2:A200=G2)(B2:B200=H2)(C2:C200=I2), 0)) instead. After entering it, press Ctrl+Shift+Enter. Curly braces will appear on both sides of the formula, which shows that the array formula is in effect. Typing the braces manually does not work; the shortcut must be used to confirm.
  5. If you do not want to use an array formula, add a helper column in column E. Enter A2&"|"&B2&"|"&C2 in E2 and fill it down to row 200, so the three conditions are combined into one key. The vertical bar serves as a separator, preventing different combinations from accidentally producing the same text when joined.
  6. In J2, use a regular lookup instead: XLOOKUP(G2&"|"&H2&"|"&I2, E2:E200, D2:D200, "Not found"). The separator in the helper column must be the same as the one used in the concatenation.
  7. If the same set of conditions may correspond to multiple rows, use FILTER to list all results, for example FILTER(D2:D200, (A2:A200=G2)(B2:B200=H2)(C2:C200=I2), "Not found"). The results will automatically spill down into multiple cells. If you need the total amount instead, use SUMIFS(D2:D200, A2:A200, G2, B2:B200, H2, C2:C200, I2).

Verify item by item after completion

After receiving the results, do not use them directly. Check each item against the table below.

Inspection itemHow do you see it?What should I do if I have a problem?
Does the result correspond to the correct row?Using the filter feature in the original table, manually filter out the rows matching the three conditions, then compare the amounts.If the results are inconsistent, check whether the criteria inputs contain extra spaces or typos, and use TRIM to clean the data.
Is the number of matching rows only one?Use COUNTIFS(A2:A200, G2, B2:B200, H2, C2:C200, I2) to count rowsThe result being greater than 1 means there are duplicate records. Switch to FILTER to view all the results, then decide which one to keep.
Return "Not found"?Does cell J2 display prompt text?Check whether the conditions exist in the table, paying special attention to differences such as "Q2" and "2", and "手机" and "手机 " (with a trailing space).
Is the helper column concatenation correct?Randomly select a few rows and check whether the content in column E contains three conditions and two vertical barsIf a row is missing its vertical line, it is usually because the cells have been merged or the formula has not been filled down.
Do numbers participate in calculations as numbers?Check the amount column with ISNUMBERThe text numbers can't be summed; you can convert them to numeric values using Text to Columns or by multiplying by 1.

After verification is complete, it is recommended to save an unmodified copy of the original spreadsheet to avoid accidentally deleting information while cleaning up the data.

❓ Frequently Asked Questions (FAQ)

1. My Excel doesn't have XLOOKUP. Can I still use it?

Yes. Replace the new-version formula with the INDEX plus MATCH form, enter it with Ctrl+Shift+Enter, and you will get the same result. You can also use a helper column that concatenates the keywords; this approach works in all versions.

2. Can VLOOKUP directly perform a three-condition lookup?

VLOOKUP can only use the first column of the lookup range as the lookup basis, and by default it matches only one condition. To use it for a three-condition lookup, you usually need to first concatenate the keys in a helper column and make sure the concatenated key is in the first column of the lookup range. When XLOOKUP or INDEX combined with MATCH can be used directly, there is generally no need to take a detour.

3. The formula looks correct, so why does it still return #N/A?

Common causes are invisible spaces or full-width characters in the data, or numbers stored as text. You can use the LEN function to compare the lengths of two values, use TRIM to clean up spaces, and then make the criteria and the data share the same format.

4. How do I retrieve all rows when three conditions match multiple lines?

Ordinary lookups return only the first match. Excel 365 and 2021 can use FILTER to list all results that meet the criteria; if you only need the total, SUMIFS is simpler. Older versions can use a helper column with sequence numbers, combined with INDEX to pull out each result in turn.

📝 Summary

The core of a three-condition lookup is to convert each condition into "1 if it holds, 0 if it doesn't," and then combine them with multiplication. Newer versions of Excel make this easy with XLOOKUP, while older versions use INDEX together with MATCH. If you don't want to write an array formula, use a helper column. Whichever method you choose, first use COUNTIFS to confirm the number of rows, then check that the data is clean, so that the result is reliable.

Open OmniDoc and process your spreadsheet file

Updated 2026-11-29