+ Reply to Thread
Results 1 to 10 of 10

Sum based off two colum criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    30

    Sum based off two colum criteria

    OK so I have a unique problem.

    I have a sheet that I am doing some vlookups with and I need to sum some values based of what is has in both column a and b for instance I have

    ADEBDATX 02/07/14 D0002242 PHY 21.92 No
    ADEBDATX 02/14/14 D0002323 PHY 21.92 No
    ADEBDATX 02/21/14 D0002405 STO 25 No
    ADEBDATX 02/21/14 D0002405 STO 50 No
    ADRIGRTX 02/07/14 D0002243 ADF 420.58 No
    ADRIGRTX 02/07/14 D0002243 ADF 365.22 No
    ADRIGRTX 02/07/14 D0002243 ADF 350.34 No

    I need to for each row that has ADEBDATX so sum PHY, STO and for each row with ADRIGRTX to sum ADF (There would also be rows with STO FSC etc etc)

    So I need to if column a = ADEBDATX and column D = PHY sum sum E wher d= PHY; then sum e where d = sto... Really I need to be able to use somet

    (That may not have been clear so here is another attempt)

    I want to search the sheet for any row with ADEBDATX and sum column E for all those rows that also have ADF in column D.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Sum based off two colum criteria

    assuming your data is arranged in A1 to F10 then in H1 enter ADEDATX in I1 enter ADF then in J1 try below
    =SUMIFS($E$1:$E$7,$A$1:$A$7,H1,$D$1:$D$7,I1)

    Incase you want to search two criteria in same range i.e. PHY Or STO
    then use as below
    =SUMPRODUCT(SUMIFS($E$1:$E$7,$A$1:$A$7,H1,$D$1:$D$7,{"PHY";"STO"}))

    syntax for sumifs is as below
    =sumifs(range to sum, criteria range1, criteria to search in criteria range1.... and so on for other criteria)
    Last edited by hemesh; 05-15-2014 at 06:08 PM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Registered User
    Join Date
    06-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Sum based off two colum criteria

    OK I am using =SUMIFS(Sheet1!E1:E3439,B4:B500,B4,Sheet1!D1:D3439,"BOB") in the atatched sheet but its returning #value! it looks like the references are right but the logical test is off...

    O-O Pay Summary Feb 2014.xlsx

    Thanks

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Sum based off two colum criteria

    Deleted post
    Last edited by AlKey; 05-26-2014 at 12:32 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Sum based off two colum criteria

    Hello Craig what you are trying to achieve!

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Sum based off two colum criteria

    try using
    =SUMIFS(Sheet1!E1:E3439,Sheet1!A1:A3439,B4,Sheet1!D1:D3439,"BOB")

  7. #7
    Registered User
    Join Date
    06-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Sum based off two colum criteria

    So what if I wanted to grab multiple items on the second criteria ie =SUMIFS(Sheet1!E1:E3439,Sheet1!A1:A3439,B4,Sheet1!D1:D3439,"BOB";"STO";"STP") i tired that no go.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum based off two colum criteria

    Try it like this...

    =SUM(SUMIFS(Sheet1!E1:E3439,Sheet1!A1:A3439,B4,Sheet1!D1:D3439,{"BOB","STO","STP"}))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Registered User
    Join Date
    06-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Sum based off two colum criteria

    P.S. The equation appears to be working perfectly. and my last question using =SUMPRODUCT(SUMIFS(Sheet1!E1:E3439,Sheet1!A1:A3439,B4,Sheet1!D1:D3439,{"STO";"BOB"})) worked

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum based off two colum criteria

    with an pivot table.

    see the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Locate max value of one column based on criteria in another colum
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 08:05 PM
  2. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  3. Locate max value of one column based on criteria in another colum
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 09:05 AM
  4. [SOLVED] Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  5. [SOLVED] Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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