transcript

excelisfun - Excel XLOOKUP Function with Three Lookup Values?–- Excel Magic Trick 1601

Thumbnail of the video “excelisfun - Excel XLOOKUP Function with Three Lookup Values?–- Excel Magic Trick 1601”
Download Markdown
Community upload. AI output has not been independently verified.

In this video we need to look up an ID code based on one to three different lookup values. The state determines the column, but product and sales rep determine the row. Now we'll see two different ways to do this: the new way and the old way.

Well, the new way means we're using the amazing new XLOOKUP function. As of September 13, 2019, XLOOKUP is only in Office 365 insider. Microsoft says within a few months everyone in Office 365 will have this new amazing function, so we want to use XLOOKUP. We first need to look up the entire column, so California is the lookup value for these column headers, the lookup array. Notice it's one row by three columns, comma, the return array. In order to use XLOOKUP, both lookup and return had better have three columns, but because the return array has three columns and multiple rows, now XLOOKUP will know to return all the rows. So in essence we're looking up, yes, all the rows, but a full column, close parenthesis.

Now, in the new Excel calculation engine, when we have a formula that delivers multiple items, when you hit enter it spills the answer. I click back in our lookup cell and press F2, and that delivered column will now become the return range in our second XLOOKUP. So after the equal sign, XLOOKUP. But wait a second, we have two lookup values. No problem. For lookup value, I can simply select product, use the join operator ampersand, and select sales rep. Comma, lookup array. We'll have two columns. Guess what XLOOKUP can do? So many things. In fact, right in this argument we can just make an array operation and it will handle it perfectly. Since I joined those two values, I need to join these two columns with the join operator, comma, and there's our finished formula: joined lookup value, array operation, and a second XLOOKUP to look up the whole column, close parentheses. And that's it. Now I can change and look up Washington. Boom, quad sales are up one, and we've looked it up.

Now the bonus formula for this video, we'll look at it in a second, but the problem has always been, before Office 365's new calculation engine, anytime we had to make an array operation we had to worry about what keystroke to use to get that formula to work. But here, inside of XLOOKUP, we just make the array operation and hit enter. We don't have to worry.

Here's how we did it before. We went ahead and used INDEX on a two-way lookup. We need to find the right column index number and row index number. For row number, since we had two values, we went ahead and made the same join inside of MATCH with lookup value. But when we got to joining the columns, we could have used this join array operation without INDEX, but then we'd have to use Control+Shift+Enter. So one of the tricks we used to do was go ahead and just join that column, leave row number empty, and then INDEX would deliver that whole column, which MATCH could understand without using Control+Shift+Enter. So we'd look up the row number based on two lookup values, and then looking up the column index number was easy with MATCH.

All right, if you want to learn lots more about XLOOKUP, I have a comprehensive video, and in our next video we'll use XLOOKUP with three lookup values to do lookup adding.