+ Reply to Thread
Results 1 to 10 of 10

Sum multiple Columns if Col Date <= PTD Date

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Sum multiple Columns if Col Date <= PTD Date

    I have tried the following (and variations thereof) "=SUMPRODUCT(--(TEXT($P$5:$AY$5,"mmm-yy")=TEXT($BD$4,"mmm-yy")),$P78:$AY78)"

    My goal is to Sum up the cells in the row where the Column date in mmm-yy format <= to the Project to date Actual Date.

    I figure the difference between the Budget and Actual would then be equal to Project to date Forecast

    Can anyone spot my error? Is there another way to accomplish my goal?

    File is attached
    Attached Files Attached Files
    Last edited by dawnmau; 07-12-2010 at 04:00 PM. Reason: NOW it's solved!
    Dawn - Guru in Training

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum multiple Columns if Col Date <= PTD Date

    Try this;

    =SUMPRODUCT(--(TEXT($P$5:$AY$5,"mmm-yy")+0<=TEXT($BD$4,"mmm-yy")+0),$P18:$AY18)

    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum multiple Columns if Col Date <= PTD Date

    Are you trying to convert everything to the first of the month?

    This would work:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Re: Sum multiple Columns if Col Date <= PTD Date

    Actually ChemistB's worked. And I was SOOOOO close! Thanks for the fresh pair of eyes! You guys are great!

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum multiple Columns if Col Date <= PTD Date

    Although it works for you now, note that:

    =TEXT(BD4,"mmm-yy")+0

    converts your June-10, to June 10th, 2010

    it is taking the text string "Jun-10" and adding 0 to coerce is it makes it think that this is month and day.. and it assumes current year.

    so if you had June-11 in BD4 it would convert that to June 11th, 2010.. which is not what you might have expected.

    That is why I did not use that tempting method.

    Actually, I am sure that Daddylonglegs will come up with an even better method to ensure accurate summation.
    Last edited by NBVC; 07-12-2010 at 02:34 PM. Reason: typo

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum multiple Columns if Col Date <= PTD Date

    Ahh, didn't see that major snafu.
    Nice catch NBVC!

  7. #7
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Re: Sum multiple Columns if Col Date <= PTD Date

    If I need for it to be the End of the month do I substitute the 1 for 31?
    =SUMPRODUCT(--(DATE(YEAR($P$5:$AY$5),MONTH($P$5:$AY$5),1)<=DATE(YEAR($BD$4),MONTH($BD$4),1)),$P18:$AY18) (Yours)

    =SUMPRODUCT(--(DATE(YEAR($P$5:$AY$5),MONTH($P$5:$AY$5),31)<=DATE(YEAR($BD$4),MONTH($BD$4),31)),$P18:$AY18) (mine)

    Will this work or will there be issues that I need to be aware of? and how do I correct?

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum multiple Columns if Col Date <= PTD Date

    I would suggest adding 1 to the month and removing the "=" sign so would be
    < the first of the next month (as all months do not have 31 days)

    =SUMPRODUCT(--(DATE(YEAR($P$5:$AY$5),MONTH($P$5:$AY$5),1)<DATE(YEAR($BD$4),MONTH($BD$4)+1,1)),$P18:$AY18)

    Does that work for you?

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum multiple Columns if Col Date <= PTD Date

    If the months don't have 31 days it goes over to next month beginning..

    Try:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Re: Sum multiple Columns if Col Date <= PTD Date

    Thanks Guys! Will go with NBVC to head off trouble before it starts!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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