SOLVED

IF Function

%3CLINGO-SUB%20id%3D%22lingo-sub-2159056%22%20slang%3D%22en-US%22%3EIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2159056%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20would%20I%20use%20the%20IF%20function%20or%20any%20other%20function%20to%20make%20the%20response%20acid%20(%26lt%3B7.35)%20Neutral%20(7.35-7.45)%20and%20Alkaline%20(%26gt%3B7.45)%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2159056%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2159103%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2159103%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F975990%22%20target%3D%22_blank%22%3E%40Safi23%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20say%20the%20number%20is%20in%20A2.%3C%2FP%3E%0A%3CP%3EIn%20another%20cell%2C%20say%20B2%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DIF(A2%3D%22%22%2C%22%22%2CIF(A2%26lt%3B7.35%2C%22Acid%22%2CIF(A2%26lt%3B%3D7.45%2C%22Neutral%22%2C%22Alkaline%22)))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20can%20be%20filled%20down%20if%20required.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2159238%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2159238%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F975990%22%20target%3D%22_blank%22%3E%40Safi23%3C%2FA%3E%26nbsp%3BAs%20a%20variant%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLOOKUP(A2%2C%7B0%2C7.35%2C7.450001%7D%2C%7B%22Acid%22%2C%22Neutral%22%2C%22Alkaline%22%7D)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

How would I use the IF function or any other function to make the response acid (<7.35) Neutral (7.35-7.45) and Alkaline (>7.45)?

 

 

7 Replies
best response confirmed by Safi23 (Occasional Contributor)
Solution

@Safi23 

Let's say the number is in A2.

In another cell, say B2:

 

=IF(A2="","",IF(A2<7.35,"Acid",IF(A2<=7.45,"Neutral","Alkaline")))

 

This can be filled down if required.

@Safi23 As a variant:

=LOOKUP(A2,{0,7.35,7.450001},{"Acid","Neutral","Alkaline"})

 

Thank you so much! you saved me so much time!
If C8 shows 'Macrocytic' for example and C9 shows 'Hyperchromic' how would I make C10 say 'Iron deficiency' ? and then change depending on the word combinations?

@Safi23

 

=IF(AND(C8="Macrocytic",C9= "Hyperchromic"), "Iron Deficiency", IF(AND(C8="...", C9="..."), "...", "..."))

 

But if you have many combinations, it would be better to create a lookup table. We'd need to have detailed information if you want help with that.

@Hans Vogelaar 

 

I think a lookup table would be best

 

@Safi23 

In C10, confirmed with Ctrl+Shift+Enter:

 

=INDEX(Sheet2!$C$2:$C$6,MATCH(1,(Sheet2!$A$2:$A$6=C8)*(Sheet2!$B$2:$B$6=C9),0))