+ Reply to Thread
Results 1 to 5 of 5

SUMIFS function?

  1. #1
    Forum Contributor
    Join Date
    08-12-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    163

    SUMIFS function?

    is there a way to sum a column based off of two criteras for the same column.
    so say i have numbers in column A and in column B is my critera the options are UG, GU, P, and GG.
    i want to sum the numbers in column A if the corresponding cells in column B are UG or GU.

    im trying this and its not working
    =SUMIFS(A1:A15,B1:B15,"=UG",B1:B15,"=GU")

    i think that its not working because im referencing the same cells (column B) twice.

    is there another way to make this work? maybe with a OR statement

    any help would be awesome

    thanks
    JED
    Last edited by jed38; 09-06-2012 at 03:42 PM. Reason: typo

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,525

    Re: SUMIFS function?

    =SUM(IF(B1:B15={"UG","GU"},A1:A15))

    Array entered with Ctrl-Shift-Enter rather than just Enter

    Confirmed as:

    {=SUM(IF(B1:B15={"UG","GU"},A1:A15))}


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,525

    Re: SUMIFS function?

    All options:

    =SUM(IF(B1:B15={"UG","GU","P","GG"},A1:A15))

  4. #4
    Forum Contributor
    Join Date
    08-12-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: SUMIFS function?

    its giving me the #N/A response.
    i hit ctrl+shift+enter

    do you know why? the values in column A are obtained from functions does this matter?
    Last edited by jed38; 09-06-2012 at 04:24 PM.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,525

    Re: SUMIFS function?

    I can't really comment. I haven't got any data ... your data ... to test it with. Assuming they are numeric values, it should be OK.

    The two range sizes need to be the same. If the ranges are different sizes, you'll get #N/A

    Regards, TMS

+ 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