We help IT Professionals succeed at work.

What is wrong with this Excel formula with an IF statement?

98 Views
Last Modified: 2017-04-13
This is my formula:

=IFERROR(IF(OR(AND($M$4="volt";U33<>0);U33-$F$26;"");(AND($M$4="auto";U33<>0);U33+$F$26;"");""))

But I can not get it to work.

What I want is that if M4 is "volt" and U33 contains a value, then U33-F26, or if M4 is "auto and U33 contains a value, then U33+F26. If not any of these conditions are fulfilled, then write nothing in the cell (keep it blank).
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
Hi,

pls try
=IFERROR(IF(AND($M$4="volt";U33<>0);U33-$F$26;IF(AND($M$4="auto";U33<>0);U33+$F$26;""))

Open in new window

Regards

Author

Commented:
I tried it now, and it says the formula is missing a parenthesis.
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
RaminTechnical Advisor
CERTIFIED EXPERT

Commented:
Try This:

=IF(AND(M4="Volt",U33<>0),U33-F26,IF(AND(M4="Auto",U33<>0),U33+F26,""))

if required change the , to ;

Author

Commented:
Rgonzo1971, now it worked fine!

Author

Commented:
Thanks, this worked fine.