xlookup with multiple criteria

Trev13

New Member
Joined
Mar 10, 2022
Messages
6
Office Version
  1. 365
Hello from Perth Australia

I have a problem I can’t solve.

I have a large data set and needing to return 5 different prices based on month of sale & a certain product model.

The two different words are in two different cells that change over time. I tried everything I can find on the web but no luck.

I’ve had a crack at it with an xlookup formula in C4 but still doesn’t really work, even for the first three columns!

It’s important that the return is invalid if one of the criteria words is not entered.

This table is simplified, the real one has 27 columns and 70 rows!

Can anyone help?
Trev
 

Attachments

  • Captureexcel.PNG
    Captureexcel.PNG
    44.6 KB · Views: 17

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You are more likely to get a response if you provide an XL2BB sample of your data so that responders don't need to manually recreate your data.

"MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in"

See if this works for you:

20220310 Column and Row lookup Trev13.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1BASE MODELFRASERMONTHMODELPRICETTLCOMMBONUSSUPER BONUSMONTHMODELPRICETTLCOMMBONUSSUPER BONUS
2MONTH SOLDAPRILMARCHCHALLENGEP3_2T3_2C3_2B3_2S3_2APRILCHALLENGEP4_2T4_2C4_2B4_2S4_2
3Option1Option2 - LETMARCHCANYONP3_3T3_3C3_3B3_3S3_3APRILFRASERP4_3T4_3C4_3B4_3S4_3
4PRICEP4_3P4_3MARCHFRASERP3_4T3_4C3_4B3_4S3_4APRILCANYONP4_4T4_4C4_4B4_4S4_4
5TTLT4_3T4_3MARCHSPACEP3_5T3_5C3_5B3_5S3_5APRILSPACEP4_5T4_5C4_5B4_5S4_5
6COMMC4_3C4_3MARCHOCEANP3_6T3_6C3_6B3_6S3_6APRILOCEANP4_6T4_6C4_6B4_6S4_6
7BONUSB4_3B4_3MARCHDRIVEP3_7T3_7C3_7B3_7S3_7APRILDRIVEP4_7T4_7C4_7B4_7S4_7
8SUPER BONUSS4_3S4_3
9
Final
Cell Formulas
RangeFormula
B4:B8B4=INDEX($N$2:$AA$7,MATCH($B$1,INDEX($N$2:$AA$7,0,MATCH($B$2,$N$2:$AA$2,0)+1),0),MATCH($B$2,$N$2:$AA$2,0)+MATCH($A4,$N$1:$AA$1,0)-1)
C4:C8C4=LET(rngDATA,$N$2:$AA$7, rngROW2,$N$2:$AA$2, rngHDG,$N$1:$AA$1, colMONTH,MATCH($B$2,rngROW2,0), INDEX(rngDATA, MATCH($B$1, INDEX(rngDATA, 0, colMONTH+1), 0), colMONTH+MATCH($A4,rngHDG,0)-1))
 
Upvote 0
Thank Alex,
I'm new to this forum, I tried to load the excel file but it wouldn't let me.
Not sure I even understand how to apply your solution to my workbook.
I assume these codes just replace the prices I had in there?
Regards
Trev
 
Upvote 0
You can either create a new sheet and copy the whole thing into there.
Then copy either B4:B8 or C4:C8 into B4 on your real sheet.

OR

From the Cell formulas section pick either the B4 formula or the C4 formula,
highlight it and copy
paste it into B4 on your real sheet and copy it down to B8
 
Upvote 0
That is assuming your picture actually starts from Row 1 since you have cut off the row numbers.
 
Upvote 0
where all the prices have gone!
I don’t understand what you are referring to ?

Hopefully you didn’t copy my XL2BB over your data. If you want to copy what I posted by clicking on the copy button in the top left corner use a new empty sheet to paste it into.

I have logged off for the night.
 
Upvote 0
Thanks for your help Alex, what was referring to is the snip I posted show dollar figures, not T3-2 ETC..
However I have abandoned my original worksheet, I was over thinking it. But I do have a question based on a different chart.
This example attached is a simple vlookup which returns a result based on a product search word in green cell.
What I need to do is change the result in cells D2, E2 & F2 based on a second word (MO) shown in cell A4 (data on row 16)
example of what i'm trying to return is in row 6.
The real data set has hundreds of entries so can’t simply add a new set of data for, say ‘oracle mo’
Sorry I tried to create a file using the xl2bb add in but it just would not let me!
Can you help?
Trev
 

Attachments

  • EXAMPLE.JPG
    EXAMPLE.JPG
    70 KB · Views: 9
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,859
Members
449,194
Latest member
HellScout

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