Looking for If/Then function

62 Views Asked by At

I have a workbook comprised of forty-something Tabs of zip codes that each contain lists of Store Numbers. I need to state NEXT TO each store number either "Legacy" or "Swipe Up". There are thousands so it's too long to do manually with a drop-down selection. The source list of which the stores are "legacy" vs "swipe up" is under the first tab named "legacy vs swipe up" in my workbook.

How would I make this a function?
enter image description here I have added a screenshot of my workbook

I was thinking an If then function would work but I am not sure of the formula layout.

This is the layout of my "Legacy vs Swipe up" tab looks like enter image description here

1

There are 1 best solutions below

0
Robert Mearns On

A formula using the XLOOKUP function will give you the result that you are looking for.

The function is structured like this.

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found]) 

Your formula would look like this.

=XLOOKUP(B3,'legacy vs swipe up'!$B$2:$B$15,'legacy vs swipe up'!$A$2:$A$15,"MISSING store number")

For your purposes, extend the lookup_array and return_array in the formula to include the used cell in the legacy vs swipe up worksheet. Example: If your last cell was 6000, then $15 would become $6000.

enter image description here

enter image description here

Added some random data to the legacy vs swipe up worksheet so that there were store values to match the store values being looked up.