SUM XLOOKUP

volsfan210000

Board Regular
Joined
Jul 24, 2007
Messages
75
Office Version
  1. 365
Hi -

Have the current SUM XLOOKUP formula

=SUM(XLOOKUP(D$6,'Spend Plan Setup '!$L$5:$BC$5,'Spend Plan Setup '!$L$10:$BC$117):XLOOKUP($C8,'Spend Plan Setup '!$L$6:$BC$6,'Spend Plan Setup '!$L$10:$BC$117))

D$6 represents the FY
$C8 represents the month

For the 1st month it is returning the correct value but when I take the formula to second month it is giving a cumulative answer not the sum of the month I'm looking for.

MonthFY25
Oct$64,570
Nov$141,518
Dec$211,345
Jan$288,293
Feb$358,120
Mar$427,947
Apr$499,999
May$570,271
Jun$640,543
Jul$724,410
Aug$810,502
Sep$867,951
Grand Totals
$5,605,467​
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
It seems difficult to answer without knowing your other data. Could you provide a screenshot of all relevant cells?
 
Upvote 0
It seems difficult to answer without knowing your other data ....
... but let's have a guess anyway.

@volsfan210000, I think you have the wrong formula construction. Your first XLOOKUP will return the first column of data where year = FY25. And the second XLOOKUP wil return the first column of data where month = Oct. So you'll be summing across multiple columns, unless you get lucky and both columns align.

Does this work for you?

=SUM(XLOOKUP(1,('Spend Plan Setup '!$L$5:$BC$5=D$6)*('Spend Plan Setup '!$L$6:$BC$6=$C8),'Spend Plan Setup '!$L$10:$BC$117))

Or if you have Excel 365 or 2021: =SUM(FILTER('Spend Plan Setup '!$L$10:$BC$117,('Spend Plan Setup '!$L$5:$BC$5=D$6)*('Spend Plan Setup '!$L$6:$BC$6=$C8)))
 
Upvote 0
... but let's have a guess anyway.

@volsfan210000, I think you have the wrong formula construction. Your first XLOOKUP will return the first column of data where year = FY25. And the second XLOOKUP wil return the first column of data where month = Oct. So you'll be summing across multiple columns, unless you get lucky and both columns align.

Does this work for you?

=SUM(XLOOKUP(1,('Spend Plan Setup '!$L$5:$BC$5=D$6)*('Spend Plan Setup '!$L$6:$BC$6=$C8),'Spend Plan Setup '!$L$10:$BC$117))

Or if you have Excel 365 or 2021: =SUM(FILTER('Spend Plan Setup '!$L$10:$BC$117,('Spend Plan Setup '!$L$5:$BC$5=D$6)*('Spend Plan Setup '!$L$6:$BC$6=$C8)))
Thanks!!!

@StephenCrump both of these worked perfectly!!

one question! On the =SUM(XLOOKUP(1. What does the (1 represent
 
Upvote 0
1 is the product of two boolean TRUE values. Here's a simple example to illustrate:

ABCDEFGHI
1FY24FY24FY24FY25FY25FY25
2JulAugSepOctNovDec
3123456
4FindFY25789101112
5Nov131415161718
6Result33
7
8In steps ...
9Match yearFALSEFALSEFALSETRUETRUETRUE
10Match monthFALSEFALSEFALSEFALSETRUEFALSE
11Match both000010
12
13Get column5
1411
1517
16Get sum33
Sheet1
Cell Formulas
RangeFormula
D3:I5D3=SEQUENCE(3,6)
B6B6=SUM(XLOOKUP(1,(D1:I1=B4)*(D2:I2=B5),D3#))
D9:I10D9=D1:I1=B4
D11:I11D11=D9#*D10#
D13:D15D13=XLOOKUP(1,D11#,D3#)
D16D16=SUM(D13#)
Dynamic array formulas.
 
Upvote 0
both of these worked perfectly!
By the way, it would be helpful if you updated your account details to show which version of Excel you're using, as the best solution may vary by version

If FILTER() works for you, then presumably you have 365 or 2021. But there are some functions in 365 not available in 2021, hence it would be good for us to know your version.
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,571
Members
452,652
Latest member
eduedu

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