+ Reply to Thread
Results 1 to 2 of 2

SUM with multiple conditions

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    1

    SUM with multiple conditions

    Hi.

    Not sure if I should be using SUMIF( SUM(IF or SUMPRODUCT, but I cant seem to get what I want.

    Thanks in advance for your solutions.

    I Have 3 columns

    A1: Work B1: Hours C1: Date
    A2: Legal B2: 2 C2: 01/01/01
    A3: Legal B3: 3 C3: 01/01/01
    A4: Expenses B4: 2 C4: 01/01/01
    A5: Other B5: 1 C5: 02/01/01
    A6: Legal B6: 3 C6: 02/01/01

    etc etc down to about 300 rows.

    A300: Legal B300: 4 C300: 04/02/01

    In plain english, what i'd like is a conditional sum to add the hours if the work type is legal and the date is greater than say 02/01/01 but less than say 09/02/01.

    D4 contains the upper date and D5 the lower date.
    D6 contains the "work area" i.e legal

    What I have so far (generated partially by the conditional sum wizard), doesn't seem to work.

    =SUM(IF(C2:C300<=D4, IF(C2:C300>=D5, IF(A2:A300=D6, B2:B300, 0),0),0)))

    Any suggestions as to what is wrong, or what might be causing the problem?

    If it would help I could post up a spreadsheet, but i would need to remove all the personal data.

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

    Re: SUM with multiple conditions

    That formula should work, but you need to remove one closing bracket at the end, and then you need to confirm it with CTRL+SHIFT+ENTER. You should see { } brackets appear around it.

    You can also use SUMPRODUCT:

    =SUMPRODUCT(--(C2:C300<=D4),--(C2:C300>=D5),--(A2:A300=D6),B2:B300)

    which can be entered with just ENTER.
    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.

+ 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