Conditional formula based on 2 pre-conditions

P

PSmith

Can anyone tell me what is wrong with the following formula? I only want the
division part of the formula to be executed if the previous two conditions
are both satisfied, if either one isn't satisfied, then I'd like it to return
the "--" value but I can't seem to get the parentheses right. Many thanks.

=IF(D57<>"NA"& IF(D22>0,D22/D57,"--"))
 
G

Glenn

PSmith said:
Can anyone tell me what is wrong with the following formula? I only want the
division part of the formula to be executed if the previous two conditions
are both satisfied, if either one isn't satisfied, then I'd like it to return
the "--" value but I can't seem to get the parentheses right. Many thanks.

=IF(D57<>"NA"& IF(D22>0,D22/D57,"--"))


In the help file, search for "Logical Functions" and then select "AND worksheet
function".
 
B

Bernard Liengme

=IF(AND(D57<>"NA", D22>0),D22/D57,"--")

but if you have #N/A in D57 from a formula then
=IF(AND(NOT(ISNA(D57), D22>0),D22/D57,"--")

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top