2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Calculating the last/latest value in a GROUPBY function?

I've got some sales data, and I've mostly got it doing what I need, but there's one part I'm struggling with.

The (sample) sales data is:

Date Time TotalAmount TotalItems AverageValue
01/01/2026 10:00:00 25 2 12.50
01/01/2026 11:00:00 30 3 10
...
01/01/2026 23:00:00 600 50 12

(the total amount are cumulative, the 11:00:00 numbers include everything from the 10:00:00 sales, plus anything after up to 11:00:00 etc., and average value is just total amount / total items)

I'm using GROUPBY to get an end of day summary:

=GROUPBY(tblSalesAmounts[Date],tblSalesAmounts[[TotalAmount]:[TotalItems]],MAX,0,0,-1)

This works fine as it's the values at the end of the day I'm looking for, but I don't know how to add in the AverageValue - I can't get it via MAX as the average can change throughout the day, and it's last value of the day I'm after.

Any ideas on how to add in a latest/last value, in addition to the max's?

submitted by /u/welshcuriosity
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#generative AI for data analysis
#real-time data collaboration
#big data management in spreadsheets
#conversational data analysis
#intelligent data visualization
#data visualization tools
#enterprise data management
#big data performance
#data analysis tools
#data cleaning solutions
#rows.com
#natural language processing for spreadsheets
#Excel compatibility
#financial modeling with spreadsheets
#no-code spreadsheet solutions
#real-time collaboration
#Excel alternatives