+ Reply to Thread
Results 1 to 5 of 5

How do I Find/Sum values based on 2 critera?

  1. #1
    bugmenot
    Guest

    How do I Find/Sum values based on 2 critera?

    Hi I have the following table,

    Names:
    A1: Jon Doe
    A2: Jane Doe
    A3: Tim Doe
    A5: Tim Tom
    A6: Jon Tool
    A7: Jon Doe

    Month:
    B1: Jan 2009
    B2: Feb 2009
    B3: Mar 2009
    B4: Apr 2009
    B5: Feb 2009
    B6: Jan 2009
    B7: Feb 2009

    Hours Worked:
    C1: 5
    C2: 4
    C3: 3
    C4: 1
    C5: 2
    C6: 3
    C7: 8

    Position:
    D1: Manager
    D2: Temp
    D3: Temp
    D5: Temp
    D6: Full-Time
    D7: Manager


    I want to create 2 tables.
    #1) That will give me the employee name, and the total number of hours they've worked in a specified time period
    #2) That will summarize the table, and filter out unecessary data, and tell me how many hours an employee worked each month. With the x axis being the employee, and the y axis being the month.

    So I have the following:

    Table #1
    Name:
    A1: Jon Doe
    A2: Jane Doe
    A3: Tim Doe
    A5: Tim Tom
    A6: Jon Tool

    Hours Worked in From Jan-Feb 2009:
    B1: 13 (5+8)
    B2: 4
    B3: 3
    B4: 1
    B5: 2
    B6: 3

    And the following table:

    Table #2
    Name:
    A2: Jon Doe
    A3: Jane Doe
    A4: Tim Doe
    A5: Tim Tom
    A6: Jon Tool

    B1: Jan 2009
    B2: 5
    B3: 0
    B4: 0
    B5: 3
    B6: 0

    C1: Feb 2009
    C2: 8
    C3: 4
    C4: 0
    C5: 0
    C6: 0

    C1: Mar 2009
    C2: 0
    C3: 0
    C4: 3
    C5: 0
    C6: 0

    ...and so on

    Can you tell me how i can do this? Any help would be greatly appreciated.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372
    Hi,

    I think rather than coming up with complicated formulas, you should have a look at pivot tables to summarize your data in various possible ways.

    Alternatively, have a look at Sumproduct.

    cheers

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Hours Worked

    Look at the attached example.
    If you have questions, post it.
    hope it helps.
    modytrane
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-16-2009
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Problem with sumproduct

    =SUMPRODUCT(--(A1:A5=F1),--(B1:B5=G1),C1:C5)

    the above formula is returning a value 0 for me. my table shows like

    XEN1 ABC BAN
    XEN2 YXH JAN
    XEN3 XXH TAN
    XHB4 YXH PRN
    XHB5 YXH VCB

    values in my F1 and G1 are F1 = XEN1 G1 = ABC And I have typed the above formula in H1. I expect BAN to be returned in H1, but is getting 0 only.

    Thanks for your help

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    try

    =INDEX($C$1:$C$5,MATCH(1,($A$1:$A$51=F1)*($B$1:$B$51=G1),0))
    confirmed with ctrl+shift+enter so it changes to array formula
    {=INDEX($C$1:$C$5,MATCH(1,($A$1:$A$51=F1)*($B$1:$B$51=G1),0))}

+ 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