+ Reply to Thread
Results 1 to 7 of 7

SUMIFS w/ multiple criteria and an or function

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Los Angeles, Ca
    MS-Off Ver
    Excel 2007
    Posts
    8

    SUMIFS w/ multiple criteria and an or function

    Data Example.xlsx

    Hey All,

    I'm trying to do a sum function for two criteria basically.

    One being the project number (see excel) and the other being a few symbols in that project which compose an expense category.

    For example I'd being looking for the total of all personnel costs (900 codes on spreadsheet) which are under project A. I'm hoping there is an easy way to do it where I can do an or and not like a sum(sumifs) for each of the project and symbol codes. something like sumifs(amount, project code, =A, symbol, =or(900,901,902) etc...

    Thanks folks,

    -Jake

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

    Re: SUMIFS w/ multiple criteria and an or function

    Probably 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.

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SUMIFS w/ multiple criteria and an or function

    +1 on the pivot table...


    But for a formula, Try

    =SUMPRODUCT(SUMIFS('Data Project Costs'!$C$2:$C$100,'Data Project Costs'!$A$2:$A$100,"A",'Data Project Costs'!$B$2:$B$100,Summary!$B$1:$B$8))

  4. #4
    Registered User
    Join Date
    01-26-2012
    Location
    Los Angeles, Ca
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: SUMIFS w/ multiple criteria and an or function

    Awesome, for the pivot table is there a way to create custom sums i.e. those 7 codes are Personnel and I ultimately just need one number for that and there are also other cost categories that contain upwards of 10-15 symbols which I need one number for.

    I realize that I can likely just add a column with the associated cost category, however it'd be nice as new data comes in if I could enter that into the data sheet and not manually enter the cost category. Hopefully that makes sense.

    With that formula it seems to work however I get a difference in the values. Is that from rounding related to the sumproduct? If so, howcan I correct that?

    Thanks Again

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SUMIFS w/ multiple criteria and an or function

    Quote Originally Posted by jacobkmc View Post
    With that formula it seems to work however I get a difference in the values. Is that from rounding related to the sumproduct? If so, howcan I correct that?
    Can you be more specific?
    What value did it actually return?
    What value did you expect and why?

    Can you post another book showing this behavior?

  6. #6
    Registered User
    Join Date
    01-26-2012
    Location
    Los Angeles, Ca
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: SUMIFS w/ multiple criteria and an or function

    Thanks, you know what I tried using the formula for a different data set and realized I was missing a symbol code so it worked perfectly!

    Quick question though, why do you need sumproduct, it seems like logically it should work with just the sumifs?

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SUMIFS w/ multiple criteria and an or function

    Because SUMIFS does AND criteria, not OR
    So putting it in SUMPRODUCT makes it create 1 SUMIFS for each of the OR criteria, then sums them.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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