Formula to find value (mapping)

Hatye

Board Regular
Joined
Jan 11, 2010
Messages
143
Hi,

I do have a worksheet with a list of a lot of account numbers, like this:
295wacw.jpg


What I want to do, is to automatically insert a value in the D column, based on the account number (column A).


The mapping should be done using this layout:
1zx15sl.jpg


Where the value I want to insert (in column D in first image) should be between one of the ranges (in column A and B), and then return the value in column C.

I need to have both from and to-value, as there might be some open gaps in the mapping scheme.


How should the formula be? :)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hatye,

from the data you posted I can't detect any gaps. So this would be enough.
Code:
[COLOR=#000000][FONT=Arial]=LOOKUP(A2,Sheet2!$A$2:$A$11,Sheet2!$C$2:$C$11)[/FONT][/COLOR]

And in case of gaps:
Code:
[COLOR=#000000][FONT=Arial]=LOOKUP(2,[/FONT][/COLOR][COLOR=#008000][FONT=Arial]1/(Sheet2!$A$2:$A$11<=A2)[/FONT][/COLOR][COLOR=#008000][FONT=Arial]/(Sheet2!$B$2:$B$11>=A2)[/FONT][/COLOR][COLOR=#000000][FONT=Arial],Sheet2!$C$2:$C$11)[/FONT][/COLOR]
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top