Can someone please help me with my formula? You can see logic in the diagram image I included in the XLSX, but my formula in E2 doesn't seem to work properly. Thanks for the help.
Can someone please help me with my formula? You can see logic in the diagram image I included in the XLSX, but my formula in E2 doesn't seem to work properly. Thanks for the help.
Try this:
=IF(AND(C2<120,D2<80),"normal",IF(AND(C2>119,C2<130,D2<80),"elevated",IF(OR(AND(C2>129,C2<140),AND(D2>79,D2<90)),"High blood pressure Stage 1",IF(OR(AND(C2>139,C2<181),AND(D2>89,D2<120)),"High blood pressure Stage 2",IF(OR(C2>179,D2>119),"Hypertensive Crisis","MISSING_VALUE")))))
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
For example, if I set the SYS to 139 and DIA to 119, it shouldn't be Stage 1, it should be Stage 2 since the DIA is higher than 90 (but less than 120).
Try this:
=IF(OR(AND(C2>129,C2<140),AND(D2>79,D2<90)),"High BP Stage1",IF(OR(C2>139,D2>89),"High BP Stage2",IF(OR(C2>179,D2>119),"Hytertensive Crisis",IF(AND(C2<120,D2<80),"Normal",IF(AND(AND(C2>119,C2<130),D2>79,D2<80),"Elevated")))))
Bharath
If I do 120 SYS and 79 DIA, I get FALSE. I think I would need to remove "D2>79," to fix that issue.
=IF(OR(AND(C2>129,C2<140),AND(D2>79,D2<90)),"High BP Stage1",IF(OR(C2>139,D2>89),"High BP Stage2",IF(OR(C2>179,D2>119),"Hytertensive Crisis",IF(AND(C2<120,D2<80),"Normal",IF(AND(AND(C2>119,C2<130),D2<80),"Elevated")))))
However, if it is then set to 130 SYS and 90 DIA, it does not read Stage 2 and instead reads Stage 1. In other words, it should always take the more severe stage.
No one???? :-(
Patience, please.![]()
Please try
=INDEX({"normal";"elevated";"High blood pressure Stage 1";"High blood pressure Stage 2";"Hypertensive Crisis"},MAX(MATCH(C2,{0,120,130,140,180}),MATCH(D2,{0,80,80,90,120})))
Ok, try this-
=IF(OR(C2="",D2=""),"Enter Value",IF(AND(C2<>"",D2<>"",C2<120,D2<80),"Normal",IF(AND(AND(C2>119,C2<130),D2<80),"Elevated",IF(AND(AND(C2>129,C2<140),D2<89),"High BP stage 1",IF(AND(AND(D2>79,D2<90),C2<140),"High BP stage 1",IF(AND(AND(C2>139, C2<180),D2<120),"High BP stage 2",IF(AND(AND(D2>89,D2<120),C2<180),"High BP Stage 2",IF(AND(C2>180,D2>0),"Hypertensive crisis",IF(AND(D2>120,C2>0),"Hypertensive crisis")))))))))
Bharath
That did the trick! Nice! Thank you.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks