Avatar of hermesalpha
hermesalpha
Flag for Paraguay asked on

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

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).
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
hermesalpha

8/22/2022 - Mon
Rgonzo1971

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
hermesalpha

ASKER
I tried it now, and it says the formula is missing a parenthesis.
ASKER CERTIFIED SOLUTION
Rgonzo1971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ramin

Try This:

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

if required change the , to ;
Your help has saved me hundreds of hours of internet surfing.
fblack61
hermesalpha

ASKER
Rgonzo1971, now it worked fine!
hermesalpha

ASKER
Thanks, this worked fine.