XLOOKUP (multiple criteria) not working

k3yn0t3

New Member
Joined
Oct 5, 2023
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hi there. Could someone kindly assist me with an XLOOKUP formula I'm using to pull in data from a master tab to another sheet? I want to pull in data onto "Store 1" sheet based on:
  • Store Number
  • month
  • year
  • line item name (revenue, COGS, etc.)

Excel Formula:
=+XLOOKUP(1,('Data Master'!$B$7:$FZ$7='Store 1'!$B26)*('Data Master'!6:6='Store 1'!H$23)*('Data Master'!5:5='Store 1'!H$22),'Data Master'!R8:NA10)

Thank you and please find examples of my two sheets below:

Single Store Template Sheet
^I need to write formula to fill in the below table based on the "Master Database" Sheet's data
*This Sheet will only show Store 1 data

Store1
Status
Opened
Closed
ST
Dept
Sq FT123456789101112123456789101112123456789101112123456789101112
201620162016201620162016201620162016201620162016201720172017201720172017201720172017201720172017 (a)201820182018201820182018201820182018201820182018201920192019201920192019201920192019201920192019
Revenue
COGS

Master Database Sheet
^I need to pull data from here. Everything is hardcoded

123456789101112123456789101112123456789101112123456789101112
201620162016201620162016201620162016201620162016201720172017201720172017201720172017201720172017 (a)201820182018201820182018201820182018201820182018201920192019201920192019201920192019201920192019
StoreStatusOpenedClosedSTDeptSq FTRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenueRevenue
1Oen1/1/2000naNYEast
5000​
10,00020,00021,00022,00023,00024,00025,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,000
2Oen1/1/2001naNYEast
6000​
11,00021,00022,00023,00024,00025,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,000
3Oen1/1/20021/1/2006NYEast
7000​
12,00022,00023,00024,00025,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,000
4Oen1/1/2003naNYEast
8000​
13,00023,00024,00025,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,00069,000
6Oen1/1/2004naNYEast
9000​
14,00024,00025,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,00069,00070,000
7Oen1/1/20051/1/2009CAWest
10000​
15,00025,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,00069,00070,00071,000
8Oen1/1/2006naCAWest
11000​
16,00026,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,00069,00070,00071,00072,000
9Oen1/1/2007naCAWest
12000​
17,00027,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,00069,00070,00071,00072,00073,000
10Oen1/1/20081/1/2012CAWest
13000​
18,00028,00029,00030,00031,00032,00033,00034,00035,00036,00037,00038,00039,00040,00041,00042,00043,00044,00045,00046,00047,00048,00049,00050,00051,00052,00053,00054,00055,00056,00057,00058,00059,00060,00061,00062,00063,00064,00065,00066,00067,00068,00069,00070,00071,00072,00073,00074,000
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
It would be helpful if you used the XL2BB, we are having to guess as to where your columns and rows are.
You are going to need 2 lookups one for the rows and one for the columns. This could be 2 Xlookups 2 filter or a mix. I find using Index match for one of the easier to follow.
If your have exactly the same number of Year/Month/Revenue columns you could cut down on the criteria and just spill the Revenue or COGS columns

Book2
ABCDEFGHIJKLMNO
1Store1
2Status
3Opened
4Closed
5ST
6Dept
7Sq FT123456789
8201620162016201620162016201620162016
9RevenueOption 1 - assume columns are exactly the same (all columns and same order) SPILL10,00020,00021,00022,00023,00024,00025,00026,00027,000
10RevenueOption 2 - Lookup specific columns10,00020,00021,00022,00023,00024,00025,00026,00027,000
Store 1
Cell Formulas
RangeFormula
G9:BB9G9=FILTER( INDEX('Data Master'!$J$8:$BE$16,MATCH(B1,'Data Master'!$A$8:$A$16,0),0), 'Data Master'!$J$7:$BE$7=$A9,0)
G10:O10G10=FILTER( INDEX('Data Master'!$J$8:$BE$16,MATCH($B$1,'Data Master'!$A$8:$A$16,0),0), ('Data Master'!$J$5:$BE$5=G$7)*('Data Master'!$J$6:$BE$6=G$8)*( 'Data Master'!$J$7:$BE$7=$A10), 0)
Dynamic array formulas.
 
Upvote 1
Solution
Thank you, Alex. Unfortunately, having trouble with the add-in (have spent an hour trying to install and troubleshoot it).

Your solution doesn't seem to work, but this is due to my lack of context.

On the master tab, I should mention that it's seven line items from an income statement laid out in columns side-by-side...so 48*7= 336 columns in a row

Revenue (Columns R to BM, so 48 columns, 12 months * 4 years), then a two-column gap (BN, BO), then Costs (Columns BP-DK)...this happens for 7 line items that will all be different rows on "Store 1" Sheet....

So you have the same month / year combinations shown many times over, the only difference is the "Revenue" "Costs" "Labor" designation.

Thank you again for your time. Really struggling to wrap my head around this.
 
Upvote 0
I was able to play around with your formula and figure it. Thank you, again, Alex.
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,088
Members
453,021
Latest member
Justyna P

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