Excel query

Lionne,

VLOOKUP is the way to go as you’ve discovered. And it MAY help with the companies being assigned a range of (bag?) numbers.

Research the use of the “range_lookup” parameter in VLOOKUP (it’s the FALSE in the fourth position). If set to TRUE, it will the matching row or an “approximate” match - in the table below a VLOOKUP(A1, Companies, 2, TRUE) where A1=2 will return “ABC”



 1  ABC
11  DEF
21  GHI


For this to work, the table must be sorted in ascending order.

True, but also important to note is that it will find matches even where there aren’t supposed to be any.

For example, if Company A has 23 - 25, and Company B has 28 - 34, but nobody has 26 - 27, it will still return either Company A or Company B when 26 or 27 is entered (depending on the range_lookup setting).

If that’s acceptable, then that’s an even quicker way than what I proposed, but I didn’t get the impression that that would work for you, Lionne.

True, but you could put in dummy rows: “26 - INVALID