Forum Discussion
IF Function to adjust calculations for gender
New to this - please be patient :-)
Medical application. Have one of two formulae to use to calculate lean body weight, depending on gender of patient in column A (M or F). there must be a simple and elegant way to either choose or adjust the formula in column D, depending on what is in column A.
Sorry, no this must be so basic, just couldnt see it anywhere back in the thread..
7 Replies
- BariDoc ESPCOPCopper ContributorHi Detlef - many thanks, looks v elegant, but using Excel for Mac the O365 version - it returns a #NAME error.. tried repeatedly to jiggle this around - is it a version problem?
- CARLOS ADRIANCopper Contributor
Other proposal would be:
=9270*B3/IF(A3="m",(6680+216*C3),(8780+244*C3))
- BariDoc ESPCOPCopper Contributor
also works perfectly - many thanks
Hello,
this one is not as elegant, but it works in all versions of Excel:
=9270*B3/(IF(A3="m",6680,8780)+IF(A3="m",216,244)*C3)
- BariDoc ESPCOPCopper Contributor
yup, that's the Badger! does the job. Many thanks to you and all who suggested solutions.
- Detlef_LewinSilver Contributor
BariDoc,
probably. SWITCH() was introduced with version 1601 Build 6568.2025.
- Detlef_LewinSilver Contributor
BariDoc,
one of many ways:
=9270*B3/(SWITCH(A3,"m",6680,"f",8780,0)+SWITCH(A3,"m",216,"f",244,0)*C3)