Module 7 · Lookup · The next bigger box

Kofi Mensah works at the counter of Kestrel Auto Parts

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.

Loading the spreadsheet…

Module 7 · Lookup

The next bigger box

Kofi Mensah, works at the counter of Kestrel Auto Parts
Kofi Mensah works at the counter of Kestrel Auto Parts

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

  1. 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

    1. Select the cell for the result.
    2. Type XLOOKUP with the value, the locked lookup range and the locked return range. Type a comma.
    3. Type the text if not found and a comma.
    4. Type the match mode 1 and a closing bracket.
    5. Press Enter.
    6. 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.

  2. 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

    1. Click cell C16.
    2. Join the start and "*" with &. Type a comma.
    3. Type the locked lookup range, the locked return range and a comma.
    4. Type the text if not found, the match mode 2 and a closing bracket.
    5. 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.