Vlookup on Two matches

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
451
Office Version
  1. 365
Platform
  1. Windows
I have a Vlookup formula (See Below)
VLOOKUP($C26,Projection!$CQ$2:$ZZ$4998,MATCH($AR$7,Projection!$CQ$3:$ZZ$3,0),FALSE)
I want to use this formula above but also MATCH($C$3,Projection!$CQ$2:$ZZ$2,0)
So it has to match on both criterias
Can this be done
I believe it can be done with Index and Match, however I don't want it to return an array but just the first result it finds?
Any help would be appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Can you post some sample data? It looks like you're matching up 2 header rows.
 
Upvote 0
First column is CQ
Row 3 is Fixture Linear
Row 4 is Cluster Number
So for example I am looking to -
Find Code 695362 (Row 10) in column CQ then match row 3 looking for a 12.0 in Row 3 and 8 in Row 4 where they match in the same column (DG)
This then returns me a value in Cell DG10 (184)
Hope I have explained that okay.
Thanks

New Sales
Store Number101102104105108109110112114118119120121122123
Fixture LinearAll8.0012.009.009.009.008.0012.009.0010.007.0011.008.5011.009.0012.00
Cluster NumberAll377531898776878
Store Unit Sales %1.12%0.99%0.76%1.30%0.91%0.84%1.08%1.17%1.14%0.40%0.90%0.93%0.83%0.67%1.12%
Sales Unit Ratio1.091.120.860.990.890.740.861.000.910.451.020.890.660.760.90
Products Stocked9037239154184165166164148183165168116185149185164185
83952832
80137115
695362153133301691121349513815814424014915591167184
7942471354023420320410367929220725114714777125135
85266623044369310485196233224254144255124210143147281366
697654225404481652502702521985135327510646220225680293
77605034315700489317591370217128333318146302187263165424
51398722958280301109216129209100313264105194390113120371
7485342116323822812741315527013825021716228996132485
63692128877669290158198222344175375277187393266132117253
88198421870418175152223310334160233347205232112156203
65967959291755509365436437725832460495368467574359336636
39363545092521440359251278574352449330244435194289201455
87110315119343261111132104339621321471493377079173
499250195594192522442442241478834821828414514788373
5337011446431849352232
557697455064248977282828402733161
582883482724555367591027051603951123
854170DeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletionDeletion
5192898126914641239586645471121456895010022841099564820460744
5529334943212652340446391492364664602216759389481387589
 
Upvote 0
The first result it finds should be CY correct? not DG.
 
Upvote 0
You changed your row numbers from your original post, so I don't know how that impacts the use of AR7 & C3.
Here are some options:-
Excel Formula:
=XLOOKUP($C26,
                          Projection!$CQ$2:$CQ$4998,
                          XLOOKUP(1,(Projection!$CQ$3:$ZZ$3=$C$3)*(Projection!$CQ$4:$ZZ$4=$AR$7),Projection!$CQ$2:$ZZ$4998),
                           "")

Excel Formula:
=INDEX(Projection!$CQ$2:$ZZ$4998,
                  MATCH($C26,Projection!$CQ$2:$CQ$4998,0),
                  MATCH(1,(Projection!$CQ$3:$ZZ$3=$C$3)*(Projection!$CQ$4:$ZZ$4=$AR$7),0))

Excel Formula:
=VLOOKUP($C26,
                          Projection!$CQ$2:$ZZ$4998,
                          MATCH(1,(Projection!$CQ$3:$ZZ$3=$C$3)*(Projection!$CQ$4:$ZZ$4=$AR$7),0),
                          FALSE)
 
Upvote 0
Solution
Thank you for the above most helpful
I will use the Vlookup

This is my formula (which is part of a larger formula (I have adjusted the cells and rows to be correct -
IF(AND(VLOOKUP($C10,
Projection!$CQ$2:$ZZ$4998,
MATCH(1,(Projection!$CQ$4:$ZZ$4=$C$3)*(Projection!$CQ$3:$ZZ$3=AR$7),0),FALSE)="",
XLOOKUP(AS$7&$C10,'Master Data'!$BD$3:$BD$100000&'Master Data'!$E$3:$E$100000,'Master Data'!$F$3:$F$100000,0)>0),"Removed",

Appreciate your help and Thanks
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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