How to use a different formula depending upon a LOOKUP result

Barty

New Member
Joined
Mar 15, 2014
Messages
6
Hi,

I am making a spreadsheet to use on client's to calculate dietary requirements. I am attempting to get one cell to perform two functions, whereby it must lookup the client's gender from another cell, then use this information to identify which formula to use to calculate if the client is at risk and display either "at risk" or "normal".

For females the range is 0.8 to 0.9 (however for the purpose of this you can just use >0.8)
For males the range is 0.9 to 1.0 (or >0.9)

First it needs to identify the gender from cell D7 so I used: (* denotes what excel should do if the result is found true)

=LOOKUP(D7,{"Female","Male"},{*,*})

But when I tried to add in the formula instruction it did not work. What I need it to do from here is identify the client is female, so use the formula >0.8 to identify "At risk" if this is true, or "normal" if this is false.


=LOOKUP(D7,{"Female","Male"},{(IF(D14>=0.8,"At Risk","Normal"),0.9})

help please :(
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
A simple IF can solve it, but I didn't get what you want to do ? You are looking in D7 and if its Male, then what will happen ?
 
Upvote 0
A simple IF can solve it, but I didn't get what you want to do ? You are looking in D7 and if its Male, then what will happen ?

Thanks Shawn.I'll give you some more info...

I have one cell which calculates the client's waist-to-hip ratio and gives a value up to 1.0
beneath that is a cell for classification. i want this cell to lookup D7 and then....

If it is male, then I want it to classify a score above 0.9 as "at risk", anything else "normal"
If it is female, then I want it to classify a score above 0.8 as "at risk", anything else "normal"

does that make more sense?
 
Upvote 0
Hi Barty !

Is this what you looking for:

[TABLE="width: 291"]
<tbody>[TR]
[TD]Patient Name[/TD]
[TD]Gender[/TD]
[TD]Waist-to-Hips Ration[/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]Patient 1[/TD]
[TD]Male[/TD]
[TD="align: right"]0.8[/TD]
[TD]Normal[/TD]
[/TR]
[TR]
[TD]Patient 2[/TD]
[TD]Male[/TD]
[TD="align: right"]0.91[/TD]
[TD]At Risk[/TD]
[/TR]
[TR]
[TD]Patient 3[/TD]
[TD]Female[/TD]
[TD="align: right"]0.75[/TD]
[TD]Normal[/TD]
[/TR]
[TR]
[TD]Patient 4[/TD]
[TD]Female[/TD]
[TD="align: right"]0.9[/TD]
[TD]At Risk[/TD]
[/TR]
[TR]
[TD]Patient 5[/TD]
[TD]Female[/TD]
[TD="align: right"]1[/TD]
[TD]At Risk[/TD]
[/TR]
</tbody>[/TABLE]

Considering the above data from Column A to D, in D2 (from above table's perspective), try:

Code:
=IF(AND(B2="Male",C2>0.9),"At Risk",IF(AND(B2="Female",C2>0.8),"At Risk","Normal"))
 
Upvote 0
Hi Barty !

Is this what you looking for:

[TABLE="width: 291"]
<tbody>[TR]
[TD]Patient Name[/TD]
[TD]Gender[/TD]
[TD]Waist-to-Hips Ration[/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]Patient 1[/TD]
[TD]Male[/TD]
[TD="align: right"]0.8[/TD]
[TD]Normal[/TD]
[/TR]
[TR]
[TD]Patient 2[/TD]
[TD]Male[/TD]
[TD="align: right"]0.91[/TD]
[TD]At Risk[/TD]
[/TR]
[TR]
[TD]Patient 3[/TD]
[TD]Female[/TD]
[TD="align: right"]0.75[/TD]
[TD]Normal[/TD]
[/TR]
[TR]
[TD]Patient 4[/TD]
[TD]Female[/TD]
[TD="align: right"]0.9[/TD]
[TD]At Risk[/TD]
[/TR]
[TR]
[TD]Patient 5[/TD]
[TD]Female[/TD]
[TD="align: right"]1[/TD]
[TD]At Risk[/TD]
[/TR]
</tbody>[/TABLE]

Considering the above data from Column A to D, in D2 (from above table's perspective), try:

Code:
=IF(AND(B2="Male",C2>0.9),"At Risk",IF(AND(B2="Female",C2>0.8),"At Risk","Normal"))


Awesome! Thanks Shawn, that works perfectly!!
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top