SOLVED

Excel code for IF function in Office 365

%3CLINGO-SUB%20id%3D%22lingo-sub-2467487%22%20slang%3D%22en-US%22%3EExcel%20code%20for%20IF%20function%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2467487%22%20slang%3D%22en-US%22%3E%3CP%3E%3DIF(C5%26gt%3BD5%2C%22WALES%22%2C%22DENMARK%22)%3C%2FP%3E%3CP%3Eso%20this%20says%20insert%20Wales%20or%20Denmark%20depending%20on%20the%20values%20in%20C5%20and%20D5.%20What%20do%20I%20add%20so%20that%20the%20output%20is%20blank%20%2F%20an%20empty%20string%20if%20C5%20and%20D5%20are%20empty%3F%20Thanks%20for%20any%20help.%20Dennis%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2467487%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-2467543%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20code%20for%20IF%20function%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2467543%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F995268%22%20target%3D%22_blank%22%3E%40DennisMetro%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPerhaps%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIF(%20(C5%3D%22%22)*(D5%3D%22%22)%2C%20%22%22%2C%0A%20IF%20(%20C5%26gt%3BD5%2C%22WALES%22%2C%22DENMARK%22)%20)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

=IF(C5>D5,"WALES","DENMARK")

so this says insert Wales or Denmark depending on the values in C5 and D5. What do I add so that the output is blank / an empty string if C5 and D5 are empty? Thanks for any help. Dennis

3 Replies
best response confirmed by DennisMetro (Contributor)
Solution

@DennisMetro 

Perhaps

=IF( (C5="")*(D5=""), "",
 IF ( C5>D5,"WALES","DENMARK") )

 

Thanks Sergei. That works well. Thank you very much. Dennis

@DennisMetro , you are welcome