View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
driller driller is offline
external usenet poster
 
Posts: 740
Default problems with if function

"I would like c1 to display b1/a1"

=IF(AND(A1="",B1=""),"", B1/A1)

when b1=3, a1=5

1. do you want to literally display as "3/5" or
2. do you want to display the result value as 0.6. or

when b1 is blank, a1=5 (vice versa)
3. do you want to literally display as "/5" or
2. do you want to display the result as blank"".

this counter question is for philosophical understanding of your need.

"novice" wrote:

I would like c1 to display b1/a1 if a1 and b1 not empty but would like c1 to
remain empty if nothing in a1 and b1

the following works but only if there is a value in a1 and b1.
=IF(AND(A1="", B1=""),"", B1/A1)

if a1 and b1 empty c1 shows hashkey value!

what am I doing wrong