Excel - Sum values only of certain months

Ganesh Gebhard 366 Reputation points
2022-01-02T19:38:00.207+00:00

Hey!

So I thought it was simple, but it seems I do need help with this.

I have two columns in my Excel sheet: Dates and Price, just like this:

161793-image.png

This list will grow over the year.

What I need is a summation of the prices of the first two months, then the next two months, etc., leading to a total of six separate summations. I tried some things to achieve this, but nothing worked so I was hoping someone here could help me.

Best,

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

3 answers

Sort by: Most helpful
  1. Herbert Seidenberg 1,201 Reputation points
    2022-01-03T02:31:32.833+00:00

    Excel 365 Pro Plus with Power Pivot and Power Query.
    Sum prices.
    Group dates into the familiar 6 Duomo's (Two months periods).
    https://www.mediafire.com/file/oepsgqqkdp3dbuc/01_02_22a.xlsx/file
    https://www.mediafire.com/file/2vyehjld529xroz/01_02_22a.pdf/file


  2. Emi Zhang-MSFT 30,126 Reputation points Microsoft External Staff
    2022-01-03T03:50:54.29+00:00

    Hi @Ganesh Gebhard ,
    I created a sample about your requirement:

    =SUMPRODUCT((MONTH($A$2:$A$31)=NUMBERVALUE((LEFT(D2,FIND("~",D2)-1))))($B$2:$B$31))+SUMPRODUCT((MONTH($A$2:$A$31)=NUMBERVALUE(RIGHT(D2,LEN(D2)-FIND("~",D2))))($B$2:$B$31))

    161786-17.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Ashish Mathur 100.8K Reputation points Volunteer Moderator
    2025-07-26T03:34:28.6733333+00:00

    Hi,

    In cell D2, enter this formula

    =LET(d,A2:A26,l,EOMONTH(DATE(YEAR(MIN(d)),MONTH(MIN(d)),1),{1;3;5;7;9;11}),IFNA(HSTACK(EOMONTH(l,-2)+1,l,DROP(GROUPBY(XMATCH(d,l,1),B2:B26,SUM),,1)),""))

    Hope this helps.

    User's image

    0 comments No comments

Your answer

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