+ Reply to Thread
Results 1 to 2 of 2

Adjusting formula with nested IF and/or functions

  1. #1
    Registered User
    Join Date
    02-02-2023
    Location
    Nova Scotia, Canada
    MS-Off Ver
    Version 2208
    Posts
    5

    Adjusting formula with nested IF and/or functions

    I am looking to create a formula to help me determine if a dose of a medication is appropriate based on a few variables. the columns I have are the following:
    J2=creatinine clearance
    L2=type of renal replacement therapy (has three possible values: IHD, SLED, or CRRT)
    M2=dose (has two possible values: 2.25 or 3.375)

    Based on the criteria the dose is appropriate in the following situations:
    J2>20 OR L2=CRRT AND M2 = 3.375,
    J2<20 OR L2=IHD OR L2 = SLED AND M2=2.25.

    This is the formula I have so far:
    =IF(AND(OR(J2>20,L2="CRRT"),(M2=3.375)),"YES",IF(AND(OR(J2<20,L2="IHD",L2="SLED"),(M2=2.25)),"YES","NO"))

    It seems to be working except when J2>20,L2=IHD and M2=3.375 the output is that the dose is appropriate when it shouldn't be, as if L2=IHD M2 has to equal 2.25 for the dose to be appropriate. Would greatly appreciate any help or advice!
    Attached Files Attached Files
    Last edited by nmkl98; 02-02-2023 at 10:23 PM.

  2. #2
    Registered User
    Join Date
    01-05-2022
    Location
    Indonesia
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    51

    Re: Adjusting formula with nested IF and/or functions

    I't quite ambiguous because there's no wrong about your rules and the case
    J2>20,L2=IHD and M2=3.375 the output is that the dose is appropriate when it shouldn't be
    First let's separate the logic of the formula

    J2>20 OR L2=CRRT
    AND
    M2 = 3.375,

    the case is
    J2>20 (MATCH) , L2=IHD (NOT MATCH)
    AND
    M2 = 3.375 (MATCH)

    So, when 1 (match) of OR logic meet 1 (match) AND logic the result should be true/yes

    Although the L2 is not match but the J2>20 is match, which fulfill the OR logic

    and the AND logic is suitable too because
    M2 = 3.375

    I suggest you to add more rules like why the case above should not appropriate when the case is met the criteria that result to YES
    I guess you missed something about the OR and AND logic that makes the case not meet the criteria

    Edit : I missed something, did you mean this?
    J2>20
    OR
    L2=CRRT AND M2 = 3.375

    instead of

    J2>20 OR L2=CRRT
    AND
    M2 = 3.375
    Last edited by muhammadridho30; 02-03-2023 at 12:16 AM.
    I'm not an expert, but I'll try

+ 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. [SOLVED] Median formula with nested if functions or array
    By dianaCatz in forum Excel General
    Replies: 8
    Last Post: 01-20-2023, 05:31 AM
  2. VLOOKUP formula fails in formula with multiple nested IF functions
    By rps1969 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-05-2022, 12:09 PM
  3. [SOLVED] nested IF formula with ISBLANK and MAX functions
    By Jasminia in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-16-2021, 05:19 AM
  4. [SOLVED] Nested IF formula but with other functions included? Possible?
    By JeninQC in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2017, 08:48 AM
  5. [SOLVED] Adjusting nested IF function
    By PistolPete7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2017, 07:08 AM
  6. If Formula with nested functions
    By sharper1989 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-14-2012, 08:44 AM
  7. Replies: 2
    Last Post: 02-01-2011, 06:51 PM

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