+ Reply to Thread
Results 1 to 12 of 12

get sum based on current month

  1. #1
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    get sum based on current month

    hi,

    starting at A6 i have series of dates(sequence of months)
    at B6 i have amounts

    how do you get the sum of amounts in column B based on current month
    add the amount next to the current month down to the last row with data
    then show the sum in B3
    and show the last date in the row of column A in B4

    and make the sum in B3 and the date in B4 to auto update if i add series of date-amount in column A-B

    also in row 3
    how do you also get the sum of amounts next the cell value "BALANCE" and show the sum in B1 sheet "BALANCE-TOTAL CA"
    how do you also get the sum of amounts next the cell value "TOTAL CA" and show the sum in B2 sheet "BALANCE-TOTAL CA"

    attached sample file
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-14-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: get sum based on current month

    May be this could help you as please see on the attached Excel.

    copy of the formula on B3

    =2000*(COUNTA(A6:A40)-MATCH(B1,A6:A6:A40,0)+1)

    copy of the formula on B4

    =LARGE(A6:A40,1)
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: get sum based on current month

    To SUM up to and including month in B1

    in B3

    =SUMIF($A$6:$A$1000,"<=" &$B$1,$B$6:$B$1000)

  4. #4
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: get sum based on current month

    @REV thanks for the reply im actually dealing with different amounts, thanks for the large formula

    @JOHNTOPLEY thanks for the reply
    the comparison should be ">=" right?
    also the sum is less than the actual sum i think it does not include the current month only the succeeding months

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: get sum based on current month

    No, the < = is correct, but you did not specify when you need the sum to start from?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: get sum based on current month

    the sum starts at the month-year in column A that is the same as the current month

    i tried to use the <= the shown sum is not correct
    when i use the >= the shown sum is less than 1 month than the correct sum

    Quote Originally Posted by FDibbins View Post
    No, the < = is correct, but you did not specify when you need the sum to start from?
    Attached Files Attached Files
    Last edited by k1dr0ck; 06-04-2018 at 12:43 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: get sum based on current month

    so i had an idea to subtract a month from the current date to get the correct sum

    A2 is TODAY()
    B2 is DATE(YEAR(A2), MONTH(A2) - $C$2, DAY(A2))
    C2 is 1

    then B3 is SUMIF($A$6:$A$1000,">=" &$B$2,$B$6:$B$1000)

    it now shows the correct sum on B3

    my problem now is when i copy-paste the formula of B3 to say F3
    it does not auto update the columns to SUMIF($E$6:$E$1000,">=" &$F$2,$F$6:$F$1000)

    is there a way to auto update the columns when you paste the formula?

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: get sum based on current month

    The reason you are one month short is you are using TODAY() as the start date so 01/06/2018 in column A is less than TODAY (4/06/2018) so will be excluded.

    So either test for month /year OR change dates in A to be month-end dates e.g. 28/02/2017

    and use

    =SUMIF($A$6:$A$1000,">=" &INT($B$1),$B$6:$B$1000)

    See attached where dates have been changed.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: get sum based on current month

    To "auto" update

    =SUMIF($A$6:$A$1000,">=" &INT(B$1),$B$6:$B$1000)

  10. #10
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: get sum based on current month

    hi,

    thanks for the reply
    how do you auto update the other columns
    =SUMIF($A$6:$A$1000,">=" &INT(B$1),$B$6:$B$1000)

    when i paste the formula to F3 it should auto update to
    SUMIF($E$6:$E$1000,">=" &INT(F$1),$F$6:$F$1000)
    Last edited by k1dr0ck; 06-04-2018 at 04:05 AM.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: get sum based on current month

    in B3

    =SUMIF(A$6:A$1000,">=" &INT(B$1),B$6:B$1000)


    Copy /paste to F3

  12. #12
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: get sum based on current month

    got it! thanks alot!

+ 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. [SOLVED] want to get the remaining days of the current month based on that respective month's one d
    By bala04msw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-09-2017, 04:47 AM
  2. [SOLVED] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  3. [SOLVED] Pick a cell containing current month actulas based what the current month is.
    By vanbasten007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2014, 01:17 AM
  4. 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
  5. 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
  6. [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
  7. [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

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