Excel formula lookup or v look look up

kumar1803

Board Regular
Joined
Jan 7, 2015
Messages
110
I would like the look for value and assigned a flat% based on value: for example:

columnA. Column B
tier name. A+

flat%. Lookup formula

if column b says "A+" then flat is 1%, if only "A " then 1.5% and so on.
 
C7: A-

B1:

=LOOKUP(C7,{"A","A+","B","C","D"},{0.02,0.02,0.02,0.01,0.01})

Yes, we can a hard-coded in VLOOKUP too...

C1:

=VLOOKUP(C7,{"A",0.02;"A+",0.02;"B",0.02;"C",0.01;"D",0.01},2,0)

I see.

So in this case, would you recommend VLOOKUP over LOOKUP because LOOKUP will continue to display 0.01 when anything greater than D (i.e. E, F...) is entered? Or is there another reason/advantage?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I see.

So in this case, would you recommend VLOOKUP over LOOKUP because LOOKUP will continue to display 0.01 when anything greater than D (i.e. E, F...) is entered? Or is there another reason/advantage?

Yes, we have an exact match situation, so VLOOKUP with match-type set to 0 is preferable (or Index\Match with Match set up to effect an exact match).

If you would insist on Lookup because the match is sorted in ascending order...

=IF(LOOKUP(C7,{"A","A+","B","C","D"})=C7,LOOKUP(C7,{"A","A+","B","C","D"},{0.02,0.02,0.02,0.01,0.01}),"")

but there is no need to play this game for such a small match range.
 
Upvote 0
Yes, we have an exact match situation, so VLOOKUP with match-type set to 0 is preferable (or Index\Match with Match set up to effect an exact match).

If you would insist on Lookup because the match is sorted in ascending order...

=IF(LOOKUP(C7,{"A","A+","B","C","D"})=C7,LOOKUP(C7,{"A","A+","B","C","D"},{0.02,0.02,0.02,0.01,0.01}),"")

but there is no need to play this game for such a small match range.

Makes sense. Thanks for the insight Aladin.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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