Module 7 · Lookup
The next bigger box

Kofi packs the orders. Each part needs the smallest box that fits. And some customers remember only the start of a part name. XLOOKUP has a match mode for both problems.
Steps
Find the next larger value
The fifth value of XLOOKUP is the match mode. 1 means: an exact match, or else the next larger value.
How to do it
- Select the cell for the result.
- Type XLOOKUP with the value, the locked lookup range and the locked return range. Type a comma.
- Type the text if not found and a comma.
- Type the match mode 1 and a closing bracket.
- Press Enter.
- Match mode -1 finds the next smaller value. Unlike VLOOKUP with TRUE, XLOOKUP does not need a sorted table.
=XLOOKUP(D5,$H$5:$H$8,$I$5:$I$8,"Too big",1)Task: Find the box for the other parts. Fill in E6:E12.
Find a text by its start
Match mode 2 lets you use * in the value to find. "Bat*" finds the first text that starts with Bat.
How to do it
- Click cell C16.
- Join the start and "*" with &. Type a comma.
- Type the locked lookup range, the locked return range and a comma.
- Type the text if not found, the match mode 2 and a closing bracket.
- Press Enter.
=XLOOKUP(B16&"*",$I$13:$I$20,$H$13:$H$20,"No match",2)Task: Find the part numbers for the other starts. Fill in C17:C20.