Skip to content
Show
Left Lookup in Excelwith XLOOKUP (made easy)When users learn to perform a lookup in Excel, it doesn’t take long before a situation arises that causes the user to ask… “How do I perform a lookup to the LEFT?” Because most users are using the VLOOKUP function when this occurs, the sad answer is, “You can’t.” This is one of the limitations of the VLOOKUP function; all return items must be to the right of the lookup (or ‘key’) column. But not anymore! With Excel’s upcoming XLOOKUP function, looking up an item to the left of the ‘key’ column couldn’t be easier. Let’s see how. The Issue at HandWe have a list of employee names and we want to generate a list of employee IDs beside the names. On a separate tab named “Master”, we have a table of the employee names, their IDs and departments. The problem is that the column we are to discover the name (the ‘key’ column) is to the right of the ID column. If we were to perform this lookup using the tried and true VLOOKUP function, we would have to rearrange the columns, so the employee name was to the left of the ID column. But what if you can’t rearrange the columns? XLOOKUP to the Rescue!The logic of XLOOKUP works like so: =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]) NOTE: arguments in square brackets are optional.
For our example, we want to search for the name in cell A4 within the range of cells C3:C33 on the Master sheet. If a match is located, we wish to return a value from the same row of cells A3:A33 on the Master sheet. =XLOOKUP(A4, Master!$C$3:$C$33, Master!$A$3:$A$33) IMPORTANT: Don’t forget to reference the lookup and return columns as absolute references (dollar signs). This way, the references won’t change when you fill the formula down to the other employee names. “Gary Miller” exists on row 22 of the Master sheet and his ID is “ID4”. When we fill the XLOOKUP formula down to the adjacent rows, we see the ID numbers for the remaining employee names. Practice WorkbookFeel free to Download the Workbook HERE. Learn Excel from a Microsoft MVPCheck out my bestselling Excel CoursesLearn anytime that fits your schedule. Download files. Practice. Apply. Why can't VLOOKUP look left?One constraint of VLOOKUP is that it can only look for values on the left-most column in the table array. If your lookup value is not in the first column of the array, you will see the #N/A error.
Can VLOOKUP go backwards?A key limitation of VLOOKUP is it can only lookup values to the right. In other words, the column with lookup values must be to the left of the values you want to retrieve with VLOOKUP. As a result, with standard configuration, there is no way to use VLOOKUP to "look left" and reverse the original lookup.
Can Xlookup search to left or right?The XLOOKUP function got its name due to its ability to look up both vertically and horizontally. Look in any direction: right, left, bottom or up. While VLOOKUP can only search in the leftmost column and HLOOKUP in the topmost row, XLOOKUP has no such limitations.
|