additional condition in vlookup

sachin483

Board Regular
Joined
Mar 31, 2015
Messages
157
Office Version
  1. 2019
Platform
  1. Windows
currently i am using the below formula for in between range but i want add an additional column (type) for verifying how can it be done
=VLOOKUP(G2,B:D,3,TRUE)

TYPEFROMTOCLSTYPEDATACLS
AA079999DAA56000 D
AA80000119999CAA95000 C
AA120000169999BAA130000 B
AA1700009999999AAA250000 A
AB0100000DAB50000
AB100001300000CAB200000
AB300001500000BAB450000
AB5000019999999AAB600000
AC0500000DAB715965
AC500001750000CAB243983
AC750001950000BAC250000
AC9500019999999AAC708492
AC1278067
AC850000
AC440773
AC566173

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi ,

If we assume that the table on the left hand side is in the range A2:D14 , and the one on the right is in the range F2:H18 , then in H3 , enter the following formula , and copy down :

=INDEX($D$3:$D$14, SUMPRODUCT(($A$3:$A$14 = F3) * ($B$3:$B$14 <= G3) * ($C$3:$C$14 >= G3), ROW($A$3:$A$14) - MIN(ROW($A$3:$A$14)) + 1))
 
Upvote 0
@sachin483, here's another approach if you'd like (assuming headers are in row 1):

=INDEX($D$2:$D$13,SUMPRODUCT(MATCH(1,($A$2:$A$13=F2)*($C$2:$C$13>=G2),0)))

Notice that the lower limits in Column B are not necessary in this approach.
 
Last edited:
Upvote 0
Control+shift+enter, not just enter, and copy down:

=VLOOKUP(G2,IF($A$2:$A$13=F2,$B$2:$D$13),3,1)

Since the match-type = 1, i.e. TRUE, this set up should be faster. Moreover, it doesn't confound retrieval anf aggregation (summing).
 
Upvote 0
thanks @NARAYANK991 and @ErikTyler formula working fine but while using formula of @Aladin Akyurek cls not reflecting properly eg:-

for AA -130000 cls "D" reflecting instead of "B" in the grid


<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,312
Messages
6,124,197
Members
449,147
Latest member
sweetkt327

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