Avatar of hermesalpha
hermesalpha
Flag for Paraguay asked on

How do I change this IF(AND(OR formula so that if the cell above has no value then do nothing?

This is my current formula (the calculation works fine):

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

But I want that if Q33 has no value (but there is a formula in it), then do nothing. What do I need to change in my code to achieve that?
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Saqib Husain

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ramin

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.
Saqib Husain

I think the only option available is VBA.

You can use this udf

Function hasfrmla(x As Range) As Boolean
If x.hasformula Then hasfrmla = True
End Function



and the formula

=if(hasfrmla(q33),"",IFERROR(IF(AND(OR($M$4="volt";$M$4="auto");Q33<>0);Q33-$F$26;Q33+$F$26);""))
hermesalpha

ASKER
Ramin, thanks, I tried your solution and it worked!

Probably your solution would have worked also Saqib.
Ramin

I'm glad I could help.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Ramin

Thanks,
Saqib Husain

The accepted formula cannot check "There is a formula" in it...unless that was not a requirement.