Lookup with 2 criterias

feni1388

Board Regular
Joined
Feb 19, 2018
Messages
129
Office Version
  1. 2021
Platform
  1. Windows
Hello...

As the image that I uploaded, I need to do a lookup with 2 criterias.
I'm combining if and vlookup together to get the result.
But the thing is that the rank sometimes changes to A4 or A6 and so on.
When the rank changes, I just need to paste a new table but then I also need to change the current formula that I'm using.
Is there any formula that won't need any adjustment even if the rank changes?
If possible, I don't want to use xlookup as there're still some old version of excel in some computers that can't use it.

Thank you.
 

Attachments

  • lookup with 2 criterias.PNG
    lookup with 2 criterias.PNG
    34.5 KB · Views: 24
Ahh.... thank you... I didn't realise that I changed the formula.
Sorry, I tried using XL2BB but somehow I couldn't extract it after downloading it to my computer.

Anyway, regarding to the formula. Is it going to be different if the price list is on another sheet? because when I'm using it like this, then the result is off.
The first few items on the top will be OK.... but the ones after that will be somehow off although sometimes is OK.
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Cost500500600800    
    
RankS5E5A5C5 vlookupindex 
 C5  
    
ItemSelling priceCartonSelling priceCartonSelling priceCartonSelling priceCartonAB02
440​
440​
 
AB05
94​
94​
 
AB02
425​
10,200​
430​
10,320​
435​
10,440​
440​
10,560​
AS05
320​
320​
 
AB03
345​
8,280​
350​
8,400​
355​
8,520​
360​
8,640​
RF48
145​
203​
off
AB05
88​
5,280​
90​
5,400​
92​
5,520​
94​
5,640​
GE30
180​
138​
off
AB06
62​
7,440​
63​
7,560​
64​
7,680​
65​
7,800​
JF10
348​
118​
off
AB07
345​
8,280​
350​
8,400​
355​
8,520​
360​
8,640​
BM13
55​
55​
OK
AB44
72​
8,640​
73​
8,760​
74​
8,880​
75​
9,000​
GL06
204​
84​
off
AS02
60​
3,600​
63​
3,780​
66​
3,960​
66​
3,960​
AS03
60​
3,600​
63​
3,780​
66​
3,960​
66​
3,960​
AS05
300​
7,200​
310​
7,440​
320​
7,680​
320​
7,680​
AS15
67​
5360​
68​
5440​
69​
5520​
70​
5600​
AS25
92​
5520​
94​
5640​
96​
5760​
98​
5880​
AS44
160​
6400​
162​
6480​
164​
6560​
166​
6640​
AS45
148​
5920​
150​
6000​
152​
6080​
155​
6200​
GL06
79​
4740​
80​
4800​
82​
4920​
84​
5040​
GL07
76​
4560​
77​
4620​
79​
4740​
81​
4860​
GL08
76​
4560​
77​
4620​
79​
4740​
81​
4860​
GL09
76​
4560​
77​
4620​
79​
4740​
81​
4860​
BM11
53​
5300​
54​
5400​
55​
5500​
56​
5600​
BM12
52​
5200​
53​
5300​
54​
5400​
55​
5500​
BM13
52​
5200​
53​
5300​
54​
5400​
55​
5500​
BM14
52​
5200​
53​
5300​
54​
5400​
55​
5500​
 

Attachments

  • sample2.PNG
    sample2.PNG
    68.6 KB · Views: 6
Upvote 0
Sorry, I tried using XL2BB but somehow I couldn't extract it after downloading it to my computer.
Have a look at the issues discussed here. Solves problems for most users.

ones after that will be somehow off although sometimes is OK.
Ah, I see the issue now, I had omitted a ",0" from my formula - see below.

Is it going to be different if the price list is on another sheet?
Should be no problem for either formula if the two sections are on different sheets.

feni1388.xlsm
ABCDEFGHIJK
1Cost500500600800
2
3RankS5E5A5C5
4
5
6ItemSelling priceCartonSelling priceCartonSelling priceCartonSelling priceCarton
7
8AB0242510,20043010,32043510,44044010,560
9AB033458,2803508,4003558,5203608,640
10AB05885,280905,400925,520945,640
11AB06627,440637,560647,680657,800
12AB073458,2803508,4003558,5203608,640
13AB44728,640738,760748,880759,000
14AS02603,600633,780663,960663,960
15AS03603,600633,780663,960663,960
16AS053007,2003107,4403207,6803207,680
17AS15675360685440695520705600
18AS25925520945640965760985880
19AS441606400162648016465601666640
20AS451485920150600015260801556200
21GL06794740804800824920845040
22GL07764560774620794740814860
23GL08764560774620794740814860
24GL09764560774620794740814860
25BM11535300545400555500565600
26BM12525200535300545400555500
27BM13525200535300545400555500
28BM14525200535300545400555500
29
Sheet3


The #N/A results below are simply because the values in col B are not included in the above sheet's data in my sample.
Note the extra ,0 near the end of the col C formula

feni1388.xlsm
ABCD
1
2A5
3vlookupindex
4AB02435435
5AS05320320
6RF48#N/A#N/A
7GE30#N/A#N/A
8JF10#N/A#N/A
9BM135454
10GL068282
11
Sheet4
Cell Formulas
RangeFormula
C4:C10C4=VLOOKUP(B4,Sheet3!A$8:I$836,MATCH(C$2,Sheet3!A$3:I$3,0),0)
D4:D10D4=INDEX(Sheet3!$B$8:$I$836,MATCH(B4,Sheet3!$A$8:$A$836,0),MATCH($C$2,Sheet3!$B$3:$I$3,0))
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

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