Download as pdf
Download as pdf
You are on page 1of 2
In case your lookup table is in another sheet, include the sheet's name in your VLOOKUP formula. For example: FALSE) =VLOOKUP(G16" "662, Orders!A2:D11, 4 Alternatively, create a named range for the lookup table (say, Orders) to make the formula easier-to-read: =VLOOKUP(G16" "E62, Orders, 4, FALSE) For more information, please see How to Viookup from another sheet in Excel, EF Note. For the formula to work correctly, the values in the helper column should be concatenated exactly the same way as in the /ookup_value argument. For example, we used a space character to separate the criteria in both the helper column (828 "&C2) and VLOOKUP formula (61&" "&G2). Formula 2. Excel VLOOKUP with multiple conditions In theory, you can use the above approach to Viookup more than two criteria. However, there are a couple of caveats. Firstly, 2 lookup value is limited to 255 characters, and secondly, the worksheet's design may not, allow adding a helper column. Luckily, Microsoft Excel often provides more than one way to do the same thing, To Viookup multiple criteria, you can use either an INDEX MATCH combination or the XLOOKUP function recently introduced in Office 365 For example, to look up based on 3 different values (Date, Customer name and Product), use one of the following formulas: SINDEX(D2:D11, MATCH(1, (GI=A2:A11) * (G2=B2:B11) * (G3=C2:C11), 0)) =XLOOKUP(1, (G1=A2:A11) * (G2=B2:B11) * (63=C2:C11), D2:D11) Where: Gt is criteria 1 (date) G2is criteria 2 (customer name) Gis criteria 3 (product) A2:A11 is lookup range 1 (dates) 82:81 is lookup range 2 (customer names) €2:C11 is lookup range 3 (products) D2:011 is the return range (quantity) {INDEX(D2:DL1, MATCH(A, (G1=A2A11) * (G2=B2:B11) * (G3=C2:C41), 0))) A 8 c D E 1 Date Customer Product Qty. 2. dan Dan Apples u 3 elan Dan Biscuits 7 4| —_1an ban sweets as 5 Lean Robert Biscuits 5 6 Lan Robert Lemons a 7 Llanfobert Sweets 2 8 2uan ban Apples 1s 9 2Jan Dan Biscuits 8 10 Quan Robert Pies uv 11 Quan Robert Sweats 16 & Note. in all versions except Excel 365, INDEX MATCH should be entered as an CSE array formula by pressing Ctrl + Shift + Enter. In Excel 365 that supports dynamic arrays It also works as a regular formula, For the detailed explanation of the formulas, please see: XLOOKUP with multiple criteria INDEX MATCH formula with multiple criteria How to use VLOOKUP to get 2nd 3°d or nth match As you already know, Excel VLOOKUP can fetch only one matching value, more precisely, it returns the first found match. But what if there are several matches in your lookup array and you want to get the 2" or 3° instance? The task sounds quite intricate, but the solution does exist! Formula 1. Viookup Nth instance ‘Suppose you have customer names in one column, the products they purchased in another, and you are looking to find the 2" or 34 product bought by a given customer. The simplest way is to add a helper column to the left of the table like we did in the first example. But this time, we will populate it with customer names and occurrence numbers like "John Doe1", “john Doe2", etc. To get the occurrence, use the COUNTIF function with a mixed range reference (the first reference is absolute and the second is relative like $8$2:B2). Since the relative reference changes based on a position of the cell where the formula is copied, in row 3 it will become $B$2:83, in row 4 - $B$2:B4, and so on. Concatenated with the customer name (B2), the formula takes this form: =B2ECOUNTIF($B92:B2, B2) The above formula goes to A2, and then you copy it down to as many cells as needed

You might also like