+ Reply to Thread
Results 1 to 13 of 13

effect:IF statement

  1. #1
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    effect:IF statement

    Hi, I have blood pressure data on 1200 ppl.

    I have listed out their systolic/diastolic BPs and the different blood pressure drugs they're on:

    ID # Systolic BP Diastolic BP alpha beta CCBs Diu.

    9090A 120.5 90 1 0 0 1
    9090B 130.5 105 0 0 1 1


    Now, what I need to do is adjust their current blood pressure to get their real blood pressure by compensating for the drugs they're on. For instance, 9090A is on an alpha blocker and a diuretic. That means that their real blood pressure is much higher than 120.5 and 90, but it's shown as 120.5/90 because of the drugs.

    This is easy to adjust when the subjects are only on one drug. But as shown in the examples above, the difficulty arises when I have to consider that they're on multiple drugs.

    The literature says that I have to adjust their blood pressure by adding the mono-drug therapy effect of the first medication with the highest effect plus the weighted average effect of the second medication. So, if alpha had a much larger effect (lets say +20) than diuretics (lets say only +15), how would I even begin to approach this through excel?

    Thank you,
    Anish
    Last edited by adhamija; 05-01-2011 at 11:57 AM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    re: effect:IF statement

    Can you post a sample workbook showing expected results?

  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,434

    re: effect:IF statement

    You could use MAX to get the highest effect value ... presumably the other value is the less effective? Assuming you can then identify the highest value, how would you calculate the weighted average of the other(s)?

    Might be easier to post a sample workbook with some typical data and desired results.

    Regards
    Last edited by TMS; 04-28-2011 at 02:37 PM.
    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


  4. #4
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    re: effect:IF statement

    I'm going to repost this. I changed up the description a little bit.
    I now have a sample workbook attached to help clarify.


    Hi there,

    I have blood pressure data on about 1200 ppl.

    I have listed out their systolic/diastolic BPs and the different blood pressure drugs they're on:

    ID # Systolic BP Diastolic BP alpha beta CCBs Diu. # of BP meds
    9090A 120.5 90 1 0 0 1 2
    9090B 130.5 105 0 0 1 1


    Now, what I need to do is adjust their current blood pressure to get their REAL blood pressure by compensating for the drugs they're on. For instance, 9090A is on an alpha blocker and a diuretic. That means that their real blood pressure is much higher than 120.5 and 90, but it's shown as 120.5/90 because of the drugs.

    This is easy to adjust when the subjects are only on one drug. But as shown in the examples above, the difficulty arises when I have to consider that they're on multiple drugs.

    The literature says that I have to adjust their blood pressure by adding the mono-drug therapy effect of the first medication with the highest effect plus the weighted average effect of the second medication. These effects are given values. And you have to do this for both the systolic blood pressure and the diastolic blood pressure.

    Confusing, I know. So, I made a sample workbook that details out the steps that need to be done with an example.

    Please let me know if you can help me

    Thank you so much,
    Anish
    Attached Files Attached Files

  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,434

    re: effect:IF statement

    Sorry, this is beyond me. I could probably do the formulae but I just don't follow the explanation.

    You obviously understand the headings and what they mean, that is, what is a drug, what is a diuretic drug and so on ... but, sadly, I don't.

    I'll try and get other forum members to have a look.

    Regards

  6. #6
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    re: effect:IF statement

    Hi TMShucks,

    Thank you for trying. I understand that it's confusing. Incase it helps at all, diuretic drugs would be any of the drugs that have the codes td, pd, ld, b+td, ace+td, pd+td, ara+td, aag+td.

    Please let me know if there is anything else I can clarify or clean up on the sample workbook.

    Thanks,
    Anish

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    re: effect:IF statement

    Are you "locked in" with the way the data is arranged?

    It might be a lot easier if the drugs were in columns grouped by diuretic and otherwise.
    For instance non-diuretics from columns B to whatever (say L) and diuretics from columns M to whatever.

    Is it safe to assume any drug or combination of drug with last character being a "d" would be a diuretic?

  8. #8
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    re: effect:IF statement

    No, the data is not locked in.

    And yes, it is safe to assume that any drug that ends in d is a diuretic (besides ccbd and *ace+ccbd).

    -Anish

  9. #9
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    re: effect:IF statement

    I took the liberty of rearranging your data tables. On the effects sheet, if a drug is a diuretic, simply change the diuretic column to true. Data entry will occur in the Med1 and Med2 columns on the Blood Pressures and medications sheet. I have added helper columns so you can see the effects of the adjustments.

    SYS0D means neither med is a diuretic and is the systolic adjustment. SYS1D means one of the meds is and is the systolic adjustment. Same for diastolic.

    Let me know if I'm on the right track.
    Attached Files Attached Files
    Last edited by tlafferty; 04-28-2011 at 06:31 PM. Reason: forgot the attachment :)
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  10. #10
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    re: effect:IF statement

    Thank you for doing this. Everything in the systolic seems accurate, but I'm a little confused on the diastolic. The diastolic should be similar to the systolic; that is, if one of the two drugs is a diuretic, the drug with the lowest effect should be multiplied by .48 (I think you have .28 listed).

    So, if SYS1D applies to a person, then DIA1D should also apply to that person.

    Thank you,
    Anish

  11. #11
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    re: effect:IF statement

    Anish -
    You are correct: there was a typo in my formula. See if the attached will do the trick for you.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    re: effect:IF statement

    Thank you for fixing it; however, the issue I mentioned in the previous post is still there. A person who is on 2 drugs in which one of them is a diuretic, let's say b and ara+td (id:19003), that person will have their SYS1D adjusted in addition to DIA1D adjusted. That's because one of the 2 drugs (ara+td) is a diuretic.Therefore, there should be an adjustment to DIA1D as well.


    In the case of ID 19004, they are on 2 drugs, none of which are a diuretic. Therefore, only SYS0D and DIA0D should be adjusted. There should be no adjustment to DIA1D (as you have shown).

    I hope I explained that clearly and hope that helps. Once again, I appreciate all the effort you've put in.

    -Anish

  13. #13
    Registered User
    Join Date
    03-04-2011
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    31

    re: effect:IF statement

    I think I figured it out! Woohoo!

    Thanks so much for all of your assistance.

+ 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