+ Reply to Thread
Results 1 to 4 of 4

sumif: multiple critera including date

Hybrid View

his5r2m sumif: multiple critera... 05-20-2009, 10:54 AM
DonkeyOte Re: sumif: multiple critera... 05-20-2009, 10:57 AM
his5r2m Re: sumif: multiple critera... 05-20-2009, 11:06 AM
DonkeyOte Re: sumif: multiple critera... 05-20-2009, 11:08 AM
  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    leeds, england
    MS-Off Ver
    Excel 2007
    Posts
    29

    sumif: multiple critera including date

    hello,

    I’m trying to get the sum of a column, with specific criteria.

    In cell 3B, in the "asbestos" sheet, I would like the sum of column H in the "incidents" sheet matching the criteria:

    Incidents sheet:
    Column A = asbestos
    Column B = January

    The code I’ve tried is:

    ((Incidents!$A$4:$A$500=$a$1)*(Incidents!$C$4:$C$500>=$A4)*(Incidents!$C$4:$C$500<=DATE(YEAR($A4),MONTH($A4)+1,1))
    I’m sure there’s really simple solution to this...

    Any help much appreciated!

    many thanks

    Rich
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sumif: multiple critera including date

    Rich, the values in A are not dates.

    Also per your other (very similar) thread note my point in post # 7 re: C56 being a text value rather than a date.

    Assuming you correct the above:

    =SUMPRODUCT((Incidents!$A$4:$A$500=$A$1)*(Incidents!$C$4:$C$500>=$A3)*(Incidents!$C$4:$C$500<=DATE(YEAR($A3),MONTH($A3)+1,1)))
    Though again as mentioned before if running XL07 you should use COUNTIFS (assuming no backwards compatibility concerns)
    Last edited by DonkeyOte; 05-20-2009 at 11:06 AM.

  3. #3
    Registered User
    Join Date
    05-07-2009
    Location
    leeds, england
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: sumif: multiple critera including date

    Last time I was counting instances when a column had specific entry: i.e. how many accident codes in a given month. This time I need a formula that gives me the total of the contents of column h: the sum number of days lost in a given month.

    I don’t need how many times a day is lost, I need how many days in total, in "asbestos" dept, in January.

    I was hoping that might be just about different enough to merit a new thread?

    apologies to all if not.

    Rich

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sumif: multiple critera including date

    Adapting the post#2 formula re:H

    =SUMPRODUCT((Incidents!$A$4:$A$500=$A$1)*(Incidents!$C$4:$C$500>=$A3)*(Incidents!$C$4:$C$500<=DATE(YEAR($A3),MONTH($A3)+1,1))*(Incidents!$H$4:$H$500))
    I myself prefer the double unary approach which is marginally quicker:

    =SUMPRODUCT(--(Incidents!$A$4:$A$500=$A$1),--(Incidents!$C$4:$C$500>=$A3),--(Incidents!$C$4:$C$500<=DATE(YEAR($A3),MONTH($A3)+1,1)),Incidents!$H$4:$H$500)
    See the link in my sig for more info on Sumproduct.

    In XL07 you would use SUMIFS in this instance (significantly quicker):

    =SUMIFS(Incidents!$H$4:$H$500,Incidents!$A$4:$A$500,$A$1,Incidents!$C$4:$C$500,">="&$A3,Incidents!$C$4:$C$500,"<="&DATE(YEAR($A3),MONTH($A3)+1,1))

+ 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