+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Total for the current month

  1. #1
    Registered User
    Join Date
    06-20-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Total for the current month

    Hi,

    I have a cell that gives the total for the current day with the formula

    =SUMIF(A2:A10014,TODAY(),D2:D10014)

    In the A column is the date format 08/06/2012. It works pretty good and always displays the current daily total. I have been looking however to have the cell next to it giving me the total for the whole of the current month, i.e. anything in colums A with the current month's value of June.

    .....Col A....................Col D
    08/06/2012..................20
    09/06/2012..................52
    09/06/2012..................18
    12/06/2012..................10

    So I want a formula that will tell me the month total of 100 from the above.

    Sorry for my long winded explanation. I've never posted in a forum before.

    Greg
    Last edited by gregwestwood; 06-20-2012 at 05:23 AM. Reason: inaccurate

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Total for the current month

    =sumproduct(--(month($a$3:$a$6)=6)*($d$3:$d$6))

    or
    =sumproduct(--(month($a$3:$a$6)=(month(e1)))*($d$3:$d$6))

    where E1 is 1/6/12

  3. #3
    Registered User
    Join Date
    06-20-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Total for the current month

    That's fine but I think that =6 refers to the month of June... I want this to update to the current month automatically.



    =SUMIF(A2:A10014,">="&TODAY()-DAY(TODAY())+1,D2:D10014)-SUMIF(A2:A10014,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)*D2:D10014)


    Did it using this, thanks for your help though. :-)

  4. #4
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Total for the current month

    If you need sum for month of the current month
    =SUMPRODUCT(--(MONTH(A2:A11)=MONTH(TODAY()))*(D2:D11))

  5. #5
    Registered User
    Join Date
    06-20-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Cool Re: Total for the current month

    Quote Originally Posted by dewilk View Post
    If you need sum for month of the current month
    =SUMPRODUCT(--(MONTH(A2:A11)=MONTH(TODAY()))*(D2:D11))

    That is excellent! Works a treat. May I be patience testing and ask how come there is -- after the first bracket?

    But it works and I'm using it now! Very cool. Thanks very much.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Total for the current month

    The -- is called a double unary and it converts TRUE/FALSE values to their numeric 1/0 equivalents.

    You could replace that SUMPRODUCT() formula with a simpler SUMIF()

    =SUMIF(A:A,">"&EOMONTH(TODAY(),-1),D:D)
    which adds up all values for dates that are after the last day of the previous month
    assuming you have no values for dates later than the current month

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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