+ Reply to Thread
Results 1 to 7 of 7

SUMIF or SUMIFS adding time where criteria is in multiple columns

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011
    Posts
    3

    SUMIF or SUMIFS adding time where criteria is in multiple columns

    Hi,

    I'm new to excel so would appreciate any help. I want to add Column B if either Column D or E contain "A". I haven't been able to make SUMIFS work, it just returns 0.

    Column B is formatted time mm:ss, Columns D and E contain single letters A-H

    Formula I've been trying is


    =SUMIFS(B6:B60,D6:D60,"A",E6:E60,"A")

    Thanks!
    Attached Images Attached Images
    Last edited by 66ev; 08-14-2013 at 11:07 AM.

  2. #2
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: SUMIF or SUMIFS adding time where criteria is in multiple columns

    Try this..

    =SUMPRODUCT((D6:D60="A")* (E6:E60="A")*(B6:B60))

    This is an array formula.
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

  3. #3
    Registered User
    Join Date
    08-14-2013
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011
    Posts
    3

    Re: SUMIF or SUMIFS adding time where criteria is in multiple columns

    Hi Raga,

    Thanks for the fast reply!

    That almost works... it adds column B if *both* D and E contain "A", but I need it to be if *either* contain "A"

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

    Re: SUMIF or SUMIFS adding time where criteria is in multiple columns

    Try one of these:

    =SUMPRODUCT(SIGN((D6:D60="A")+(E6:E60="A")),B6:B60)

    =SUMPRODUCT(--(LEFT(D6:D60&E6:E60)="A"),B6:B60)

    The 1st one is slightly faster to calculate.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    08-14-2013
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011
    Posts
    3

    Talking Re: SUMIF or SUMIFS adding time where criteria is in multiple columns

    Thanks Tony,

    I couldn't make your formula work, but I managed to work it out from another support page...

    =SUM(IF((D6:D60="A")+(E6:E60="A"),B6:B60,0))

    Thanks again for the help!

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

    Re: SUMIF or SUMIFS adding time where criteria is in multiple columns

    Quote Originally Posted by Tony Valko View Post

    =SUMPRODUCT(--(LEFT(D6:D60&E6:E60)="A"),B6:B60)
    Disregard that one. I wasn't paying attention to the requirements.

    I was assuming that the cells would either contain "A" or be blank.

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

    Re: SUMIF or SUMIFS adding time where criteria is in multiple columns

    The =SUMPRODUCT(SIGN(... version should work. Works for me.

+ 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. Replies: 2
    Last Post: 01-23-2013, 06:25 AM
  2. SUMIFS Puzzle - Trying to avoid adding multiple SUMIFS to get valid result
    By haldavid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-09-2013, 03:42 PM
  3. [SOLVED] SumIf / SumIfs with multiple Contains Text criteria
    By theweirdone in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2012, 05:22 AM
  4. Replies: 2
    Last Post: 10-05-2011, 12:43 PM
  5. Sumif for multiple criteria in one row and two columns
    By ersterli in forum Excel General
    Replies: 3
    Last Post: 08-10-2011, 07:19 AM

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.6.0 RC 1