+ Reply to Thread
Results 1 to 7 of 7

Thread: Sum, If, Dates

  1. #1
    Registered User
    Join Date
    10-20-2009
    Location
    Prineville, OR
    MS-Off Ver
    Office 2010
    Posts
    32

    Sum, If, Dates

    I've been struggling with this problem for 3 days now and I'm desperate. I know it's something simple that I just don't know yet. Hope someone here knows how to do this stuff.

    I have a sales sheet for one of my classes that I'm trying to add a sum if statement too. The dilema is that there are 3 criteria that must be met for for it to sum what I want. I want it to differentiate according to the product (T-shirt), type of purchase (credit), and by the date.

    I got it all down except for the date.
    This is what I have so far:

    =SUM(IF(DATEVALUE(10/12/2009)<A:A<DATEVALUE(10/16/2009),IF(F:F=("T-Shirt),IF(C:C=("credit"),D:D))))

    I want the values in row D to be added together if row A is inbetween date 10/12/2009-10/16/2009 and the value of row C is "credit", and the value of row F is "T-shirt". If any value in the criterion is not met then I want it to disavow the colum. If you delete the date part it works just fine.

    I've attached the file. What am I doing wrong?
    Thanks ahead of time.
    Attached Files Attached Files

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225

    Re: Sum, If, Dates

    Add the dates to your sheet so it's easy to use this in H8:

    =SUMPRODUCT(--($A$5:$A$16>=$I$4), --($A$5:$A$16<=$I$5), --($C$5:$C$16=$G8), --($F$5:$F$16=H$7), $D$5:$D$16)
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,131

    Re: Sum, If, Dates

    This really begs for a pivot table, though. Add a column that calculates week number.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    10-20-2009
    Location
    Prineville, OR
    MS-Off Ver
    Office 2010
    Posts
    32

    Re: Sum, If, Dates

    Quote Originally Posted by JBeaucaire View Post
    Add the dates to your sheet so it's easy to use this in H8:

    =SUMPRODUCT(--($A$5:$A$16>=$I$4), --($A$5:$A$16<=$I$5), --($C$5:$C$16=$G8), --($F$5:$F$16=H$7), $D$5:$D$16)
    May I ask how this is different than the sum ifs? Also are the -- needed? What do they do?

    Thanks for the super fast response.

  5. #5
    Registered User
    Join Date
    10-20-2009
    Location
    Prineville, OR
    MS-Off Ver
    Office 2010
    Posts
    32

    Re: Sum, If, Dates

    Quote Originally Posted by shg View Post
    This really begs for a pivot table, though. Add a column that calculates week number.
    I've heard wonderful things about pivot tables, and I even tried with this. Unsuccesfully. I'm good at excell, but there are so many things that I really need to learn.
    Thanks

  6. #6
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Sum, If, Dates

    Given you're using XL2007 you should use SUMIFS in preference to SUMPRODUCT - see XL Help for more info.

  7. #7
    Registered User
    Join Date
    10-20-2009
    Location
    Prineville, OR
    MS-Off Ver
    Office 2010
    Posts
    32

    Re: Sum, If, Dates

    OK, New data is put in and the formula is missing one of the cells. Whats going on? The highlighted cell (D25) isn't added into the sum of the formulas like the other ones are. What gives?
    Attached Files Attached Files

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.2.0