+ Reply to Thread
Results 1 to 5 of 5

Nesting OR() Function in SUMIFS()

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2007
    Posts
    17

    Nesting OR() Function in SUMIFS()

    Hi Everyone,

    Completely hit a wall here and would love some suggestions. I am trying to build a SUMIFS() statement with fixed and conditional criteria. I am adding the totals in a column labed "Neck" with the following:

    The fixed Criteria:
    • DischargeDate column needs a date entered (any date will do)
    • The Discipline column needs to be under "WBPC PT OUTPATIENT"

    Conditional Criteria:
    • PrimaryInsurance column has to = "HEALTH NET"
    OR
    • PrimaryInsurance column has to = "MEDICARE"

    In earlier codes I have created this which works great without conditional criteria:
    =SUMIFS(Neck,DischargeDate,">"&1/1/2013,Department,"WBPC PT OUTPATIENT",PrimaryInsurance,"MEDICARE")

    But I'm lost when trying to nest an OR() function in this SUMIFS() statement. I have tried other ways such as Coutifs and Sumifs, but I can't seem to get the logic straight. This was my last attempt:
    =IF(OR(PrimaryInsurance="HEALTH NET",PrimaryInsurance="MEDICARE"),SUMIFS(Neck,DischargeDate,">"&1/1/2013,Department,"WBPC PT OUTPATIENT"),"FAIL") ... it Failed

    I would prefer to embed my conditional with the SUMIFS() statement, but overall I really need this to work. Any help is appreicated and thank you in advance.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Nesting OR() Function in SUMIFS()

    You may use:
    =SUM(SUMIFS(Neck,DischargeDate,">"&1/1/2013,Department,"WBPC PT OUTPATIENT",PrimaryInsurance,{"MEDICARE","HEALTH NET"}))
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    02-06-2014
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Nesting OR() Function in SUMIFS()

    Wow, Thank you Izandol.

    That works perfectly and it's very concise. If you don't mind, I do have a question: does the characters {} embedded into the criteria range of a sum or sumif automatically denote a conditional set of criteria? I would just like to understand. Regardless, THANK YOU again!

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Nesting OR() Function in SUMIFS()

    It denotes an array constant. The SUMIFS formula is evaluated for each item of the array and the additional SUM function tallies the result.

  5. #5
    Registered User
    Join Date
    02-06-2014
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Nesting OR() Function in SUMIFS()

    Cool. So the Sumifs() adds up all possible combinations based upon the fixed and the conditional array of possibilities, and then the simple SUM() just adds those up. Thanks so much for the explanation!

+ 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. Need help nesting an index/match function within a Vlookup function.
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2013, 06:16 PM
  2. [SOLVED] MATCH function workaround - nesting ADDRESS function?
    By BishBosh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-18-2013, 03:45 AM
  3. [SOLVED] Nesting IF Function
    By neeners36 in forum Excel General
    Replies: 11
    Last Post: 06-21-2012, 03:59 PM
  4. Nesting Networkdays function inside and If function
    By Addison in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2006, 03:10 PM
  5. How do I nesting subtotal function within average function in Exc
    By Amy Yeh in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-19-2005, 04:06 PM

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