Forum

Notifications
Clear all

[Solved] XLOOKUP SUM

3 Posts
3 Users
0 Reactions
305 Views
(@v-r_tayloryahoo-com)
Posts: 5
Active Member
Topic starter
 

My apologies if this is the rediscovery of the wheel.  Maybe it will help someone all the same though.

 

I needed a way, using XLOOKUP, to return the sum of a range and all of the examples I came across were of the same type as shown in the 'Example 5' worksheet which use a date to establish the brackets for the sum function.  Unfortunately my workbook doesn't have dates, or any other information, that could be easily used to establish my brackets.

What I stumbled upon is what's in 'Sheet 1'.  The structure is the same as Example 5 but the XLOOKUP function is duplicated EXCEPT the search mode of the second XLOOKUP is set to -1.

 
Posted : 12/03/2025 8:22 am
Topic Tags
Alan Sidman
(@alansidman)
Posts: 220
Member Moderator
 

You can achieve this with Power Query or if you have O365 the GroupBy Function

 

Power Query

let
Source = Excel.CurrentWorkbook(){[Name="tbl_test"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Name"}, {{"total qty", each List.Sum([Quantity]), type number}})
in
#"Grouped Rows"

With Groupby here is the formula

=GROUPBY(tbl_test[[#All],[Name]],tbl_test[[#All],[Quantity]],SUM,3)

 

 
Posted : 12/03/2025 10:32 am
Anders Sehlstedt
(@sehlsan)
Posts: 968
Prominent Member
 

Hello,

Just sharing my thoughts here, all solutions leading to correct data are good solutions. Easier though to use the SUMIF(S) function for this kind of scenario, or you can stick with SUM.

=SUM((tbl_test[Quantity])*(tbl_test[Name]=E4))

Br,
Anders

 
Posted : 09/04/2025 6:46 am
Share: