+ Reply to Thread
Results 1 to 7 of 7

Sum cells based on current Month

  1. #1
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Sum cells based on current Month

    Hi all,

    I am trying to sum up the month to date of values in cells.

    I need to find a way to look up yesterdays date and sum values in a column from the start of the month to yesterdays date.

    So for this month it would be sum 1 Nov to 3 Nov (if today is the 4th Nov)

    I have attached an example to give a bit more of a guide.

    Any ideas would be much appreciated
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Sum cells based on current Month

    You've already got something very similar in E4.

    Yesterday is given by TODAY()-1, and the first day in yesterday's month is:

    DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1)

    Perhaps you can incorporate those in a modified SUMIFS formula.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Re: Sum cells based on current Month

    Thanks Pete,

    I had help putting together that formula (E4) so am not quite sure how to adjust it.

    I have just attached an attempt but it looks like it is coming out higher when I manually count up the numbers.

    Any obvious mistakes I have made?
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Sum cells based on current Month

    I think you need this in G4:

    =SUMIFS('Budget KPIs'!$C$3:$C$370,'Budget KPIs'!$A$3:$A$370,">="&DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1),'Budget KPIs'!$A$3:$A$370,"<="&TODAY()-1)

    or, if you want to refer to yesterday's date in E1:

    =SUMIFS('Budget KPIs'!$C$3:$C$370,'Budget KPIs'!$A$3:$A$370,">="&DATE(YEAR($E$1),MONTH($E$1),1),'Budget KPIs'!$A$3:$A$370,"<="&$E$1)

    (slightly shorter). Note that if today were 1st of the month this would give you last month's total.

    Hope this helps.

    Pete

    P.S. If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  5. #5
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Re: Sum cells based on current Month

    brilliant works a treat. Thanks heaps Pete.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Sum cells based on current Month

    Hi Pete,

    Thanks for your help with this.

    I want to add in a Year To Date column (Starting from the 1st July to yesterday)

    Is it possible to manipulate the Month to date formula to capture Year to date?
    You asked the above in a Visitor Message - you can do this:

    =SUMIFS('Budget KPIs'!$C$3:$C$370,'Budget KPIs'!$A$3:$A$370,">="&DATE(2013,7,1),'Budget KPIs'!$A$3:$A$370,"<="&$E$1)

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Re: Sum cells based on current Month

    brilliant thanks Pete! works great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA: Piviot table Month auto select based on current month?
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2013, 08:45 AM
  2. VBA: Piviot table Month auto select based on current month?
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2013, 07:18 AM
  3. [SOLVED] Help with a system to auto populate month names based on current month
    By rosboy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2012, 05:17 PM
  4. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 AM
  5. Replies: 6
    Last Post: 12-09-2011, 03:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1