+ Reply to Thread
Results 1 to 12 of 12

creating a formula that compares 2 outcomes

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    creating a formula that compares 2 outcomes

    Hi,

    I'm really stuck with this one, I have a formula that compares data from yesterday, and if it meets the criteria it gives me an alert. However, I need to change that to compare the data to 2 days prior and to yesterday and returning an outcome based on which of the 2 is greater than 20% for the FiO2 outcome. The same will be for the PEEP outcome, to return an alert if the value is equal to or less than 2.9. Attached is the spreadsheet, please let me know if this makes any sense.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: creating a formula that compares 2 outcomes

    You need to define expected results for all possible outcomes.
    For example, when you compare today's data to yesterday and day before, there are various possibilities.
    Both could be over 20%, either one could be over 20%, both could be under 20% etc.
    Make a table with possible inputs and respective outputs.
    Same would go for the PEEP.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: creating a formula that compares 2 outcomes

    I find your file confusing as you have Day 3 FiO2 then revert back to Day 2 ...

    but in A16

    =IF(AND(B15<>0,B11<>0),IF(MAX(B15-B11,B15-B6)>=0.2,"Alert Alert","Good"),"")

    ????

    .... based on which of the 2 is greater....
    Alert if EITHER > 0.2 ??

    Confused!!!

  4. #4
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Red face Re: creating a formula that compares 2 outcomes

    Each pt. has a starting stat, after the first day the numbers are then compared to the previous day outcome.

    I need to compare the previous 2 days and the lesser than 20% of the two days gets the alert:

    Day 1
    FiO2 40%

    Day 2
    FiO2 60% Bad

    Day 3
    FiO2 60% (still bad because it is comparing to day 1)

    Day 4
    FiO2 60% Good (is now comparing to Day 2)

    Does that explains it better?

  5. #5
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: creating a formula that compares 2 outcomes

    I have updated the file with correct formulas for FiO2. I can't seem to find a way to attach the file.
    I know I have done it before. Must be missing something.
    Tell me how to attach the file.
    Attached Files Attached Files
    Last edited by modytrane; 06-09-2016 at 11:19 AM.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: creating a formula that compares 2 outcomes

    modytrane Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: creating a formula that compares 2 outcomes

    I am sorry FDibbins, do you mean to "Reply with Quote"?

  8. #8
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: creating a formula that compares 2 outcomes

    I got it, so far is working great!!! I will let you know as soon as enter more data... Thank you so much!!!!

  9. #9
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: creating a formula that compares 2 outcomes

    Quote Originally Posted by modytrane View Post
    I have updated the file with correct formulas for FiO2. I can't seem to find a way to attach the file.
    I know I have done it before. Must be missing something.
    Tell me how to attach the file.
    I got the file, thank you so much!!!

  10. #10
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: creating a formula that compares 2 outcomes

    Quote Originally Posted by Riverstar5 View Post
    I got the file, thank you so much!!!
    Is it possible that you can explain the formula so that I can learn what the formula is actually doing? Thank you!!!

    =IF(B15<>0,IF(OR((B15-B9)>=0.2,(B15-B5)>=0.2),"Alert Alert","Good"),"")

  11. #11
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: creating a formula that compares 2 outcomes

    First IF will make sure that B15 has a non-zero value. IF not, the formula will result in a blank.
    IF B15 is non-zero, then next IF will check to see if B15 is more than 20% higher than either B9 [Day before] or B5 [2 Days before]. If B15 is higher than either B9 or B5 by more than 20% then formula will result in "Alert Alert", otherwise it will result in "Good".
    Hope that helps.

  12. #12
    Registered User
    Join Date
    05-08-2012
    Location
    Abington, PA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: creating a formula that compares 2 outcomes

    Quote Originally Posted by modytrane View Post
    First IF will make sure that B15 has a non-zero value. IF not, the formula will result in a blank.
    IF B15 is non-zero, then next IF will check to see if B15 is more than 20% higher than either B9 [Day before] or B5 [2 Days before]. If B15 is higher than either B9 or B5 by more than 20% then formula will result in "Alert Alert", otherwise it will result in "Good".
    Hope that helps.
    that was awesome!!! It even taught me how to create similar formulas!!! Thank you so much for your time!!

+ 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] Formula that compares 2 spreadsheets
    By lestergit in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2015, 07:51 AM
  2. Replies: 6
    Last Post: 08-20-2014, 12:14 PM
  3. Replies: 1
    Last Post: 08-06-2014, 09:38 AM
  4. creating a graph with outcomes of simulation of 1000runs
    By lindep in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-01-2013, 04:32 AM
  5. Replies: 3
    Last Post: 12-12-2012, 11:52 AM
  6. Creating A Formula Based On Multiple Outcomes
    By artiststevens in forum Excel General
    Replies: 8
    Last Post: 01-20-2012, 12:27 AM
  7. formula that compares different ranges
    By sir Lancelot in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2005, 04:20 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