I have a list of codes, that looks like this:
RF206
RT205
RG20
etc
And I have a list of code categories that looks like this:
Prefix Range start Range end Category
RF 1 52 Investment costs
RF 53 210 Building costs
RT 1 200 Salaries
RT 201 256 Bonuses
RG 1 19 Restaurant
RG 20 30 Transport
What I would like to do is be able to match codes to categories, like this:
RF206 Building costs
RT205 Bonuses
RG20 Transport
I appreciate that a VLOOKUP can't work, as there are multiple values for every prefix (RT, RF, etc), so I can't just lookup the codes prefix. I need a way to combine looking for an exact match for the prefix and to check if the numerical part falls between the two ends of the range, to bring back the corresponding category.