Sum of Double XLookup across multiple sheets?

calebz

New Member
Joined
Apr 2, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
We get a 11-month forecast from our customer on a weekly basis, that shows the upcoming 11 months and the quantities of all of the part numbers they expect to order from us.
So, at the end of the year, I will have 52 sheets of data that all have a different range of months and quantities.

What I was tasked to do is to make a chart that finds the average for the specific part number in the specific month across all 52 sheets.

I can get the total of a part number across all of the months in the sheet with this formula:
Excel Formula:
=SUM(XLOOKUP(A3,VSTACK('2025 Week (52):2025 Week (1)'!$A$2:$A$335),VSTACK('2025 Week (52):2025 Week (1)'!$B$2:$L$335)))
A3 = Part Number looking up
'2025 Week (52):2025 Week (1)'!$A$2:$A$335 = Columns of part numbers in the 52 sheets
'2025 Week (52):2025 Week (1)'!$B$2:$L$335 = the totals of those part numbers

What I need to do is do a nested XLookup that looks at the date as well:
(VSTACK('2025 Week (52):2025 Week (1)'!$B$1:$L$1)) = Rows of Date Headers in the 52 Sheets
but when I try it, it just gives me #Value!:
Excel Formula:
=Sum(XLOOKUP(A3,VSTACK('2025 Week (52):2025 Week (1)'!$A$2:$A$335),XLOOKUP(C2,VSTACK('2025 Week (52):2025 Week (1)'!$B$1:$L$1),VSTACK('2025 Week (52):2025 Week (1)'!$B$2:$L$335))))

Is there a different way to do lookup like this across multiple sheets without having to manually just to add up double XLookup for each sheet?

When I try doing a regular XLookup with the Vstack for the date rows instead of the Part numbers column, I get #Value!
 

Attachments

  • Double Xlookup Across Multiple Sheets.PNG
    Double Xlookup Across Multiple Sheets.PNG
    67.4 KB · Views: 8
  • Forecast Sheet.PNG
    Forecast Sheet.PNG
    104.5 KB · Views: 8
We get a 11-month forecast from our customer on a weekly basis, that shows the upcoming 11 months and the quantities of all of the part numbers they expect to order from us.
So, at the end of the year, I will have 52 sheets of data that all have a different range of months and quantities.

What I was tasked to do is to make a chart that finds the average for the specific part number in the specific month across all 52 sheets.

I can get the total of a part number across all of the months in the sheet with this formula:
Excel Formula:
=SUM(XLOOKUP(A3,VSTACK('2025 Week (52):2025 Week (1)'!$A$2:$A$335),VSTACK('2025 Week (52):2025 Week (1)'!$B$2:$L$335)))
A3 = Part Number looking up
'2025 Week (52):2025 Week (1)'!$A$2:$A$335 = Columns of part numbers in the 52 sheets
'2025 Week (52):2025 Week (1)'!$B$2:$L$335 = the totals of those part numbers

What I need to do is do a nested XLookup that looks at the date as well:
(VSTACK('2025 Week (52):2025 Week (1)'!$B$1:$L$1)) = Rows of Date Headers in the 52 Sheets
but when I try it, it just gives me #Value!:
Excel Formula:
=Sum(XLOOKUP(A3,VSTACK('2025 Week (52):2025 Week (1)'!$A$2:$A$335),XLOOKUP(C2,VSTACK('2025 Week (52):2025 Week (1)'!$B$1:$L$1),VSTACK('2025 Week (52):2025 Week (1)'!$B$2:$L$335))))

Is there a different way to do lookup like this across multiple sheets without having to manually just to add up double XLookup for each sheet?

When I try doing a regular XLookup with the Vstack for the date rows instead of the Part numbers column, I get #Value!
Welcome to MrExcel

I think that you will find it much easier to store your data in one table instead of split between sheets.
Analysis will be much easier if it's all in one table.

As data comes in you just add it to the bottom.
Code can be written to do that each week.

Code can also be written to convert the data from your existing multiple sheets into the table.

Below is an example of how it could look.

Sum of Double XLookup across multiple sheets.xlsm
ABCDEFG
1Year ReceivedWeek ReceivedItemForecast YearForecast MonthQuantity
2202514681202522138
3202513124202523599
4202514726202522359
5202513371202523627
6202514409202524507
7202512833202523346
8202512060202522508
9202514694202522690
10202513751202522317
11202514187202522626
12202513857202524137
13202512906202523645
14202512441202524947
15
Sheet1
 
Upvote 0
Another way is,

Create a helper column, like in AA1:AA52 Formula
Excel Formula:
="2025 Week (" & ROW(A1) & ")"

And in B3: Formula
Excel Formula:
=SUM(MAP($AA$1:$AA$52, LAMBDA(sh, LET(r, MATCH($A3, INDIRECT("'"&sh&"'!A2:A335"), 0), c, MATCH(B$2, INDIRECT("'"&sh&"'!B1:L1"), 0), v, INDEX(INDIRECT("'"&sh&"'!B2:L335"), r, c), IFERROR(v, 0)))))


1743624725667.png
 
Upvote 0

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