GROUPBY using months for rows when source dates are every day of the month

Michael Morris 0 Reputation points
2025-08-12T18:34:43.5333333+00:00

Hi,

I receive Sales and Invoice summaries in an Excel table. I would like to summarize the results by the month of the Sale or Invoice using GROUPBY and PIVOTBY.

The source table presents the date of each Sale or Invoice on the day it occurred so to use GROUPBY and PIVOT by I must create a new EOMONTH column for each Sale and Invoice event that GROUPBY and PIVOTBY use to summarize by month.

Is there a way to group rows by the Month and Year of each Sale and Invoice transaction without creating a helper column?

My source table before I add the helper column is:

User's image

The output of the above table using GROUPBY should be like below (or any other date format so long as months are summarized):

User's image Look forward to your help.

Mike

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. HansV 460.8K Reputation points MVP Volunteer Moderator
    2025-08-12T18:53:46.2766667+00:00

    For example:

    =GROUPBY(Table1[Invoice Date]-DAY(Table1[Invoice Date])+1, Table1[Amount], SUM, 0, 1)

    where Table1 is the name of your table.

    User's image

    You found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Ashish Mathur 99,580 Reputation points Volunteer Moderator
    2025-08-12T22:58:39.93+00:00

    Hi,

    In cell E2, enter this formula

    =LET(id,A2:A7,DROP(GROUPBY(HSTACK(YEAR(id)&TEXT(id,"mm"),TEXT(id,"mmm-yy")),C2:C7,SUM),,1))

    Hope this helps.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.