Formula Error

samsilverman

Board Regular
Joined
Nov 9, 2009
Messages
176
I am using excel 2007:

I have created the following formula (with some help from this forum), but I am getting an error message saying I am missing a left or right parentheses. Can someone help me? I can't figure it out.

=IF(ISBLANK(B17),"",IF(AND($I$8="AIRBORNE ISOLATION",L17<=-0.01,OR(AND(M17="",L18=""),AND(M17="",L18<=-0.0001,(I18+J18)>0,F18="",G18=""),
AND(M17="",L18<=-0.0001,(I18+J18)>0,(F18+G18)>0,(I18+J18)>(F18+G18),AND(M17<=-0.01,L18<=-0.0001,(I18+J18)>0,F18="",G18=""),<o:p></o:p>AND(M17<=-0.01,L18<=-0.0001,(I18+J18)>0,(F18+G18)>0,(I18+J18)>(F18+G18))),"",IF(AND($I$8="PROTECTIVE ENVIRONMENT",L17>=0.01,OR(AND(M17="",L18=""),AND(M17="",L18=0,(F18+G18)>0,I18="",J18=""),AND(M17="",L18<0,(I18+J18)>0,F18="",G18=""),AND(M17>=0.01,L18=0,(F18+G18)>0,I18="",J18=""),AND(M17>=0.01,L18<0,(I18+J18)>0,F18="",G18=""))),"",1)))<o:p></o:p>
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
=IF(ISBLANK(B17),"",IF(AND($I$8="AIRBORNE ISOLATION",L17<=-0.01,OR(AND(M17="",L18=""),AND(M17="",L18<=-0.0001,(I18+J18)>0,F18="",G18=""),AND(M17="",L18<=-0.0001,(I18+J18)>0,(F18+G18)>0,(I18+J18)>(F18+G18),AND(M17<=-0.01,L18<=-0.0001,(I18+J18)>0,F18="",G18=""),AND(M17<=-0.01,L18<=-0.0001,(I18+J18)>0,(F18+G18)>0,(I18+J18)>(F18+G18))))),"",IF(AND($I$8="PROTECTIVE ENVIRONMENT",L17>=0.01,OR(AND(M17="",L18=""),AND(M17="",L18=0,(F18+G18)>0,I18="",J18=""),AND(M17="",L18<0,(I18+J18)>0,F18="",G18=""),AND(M17>=0.01,L18=0,(F18+G18)>0,I18="",J18=""),AND(M17>=0.01,L18<0,(I18+J18)>0,F18="",G18=""))),"",1)))

Haven't bothered figuring out where exactly the error is but this no longer gives you the error message.

Good luck!
 
Upvote 0
=IF(ISBLANK(B17),"",IF(AND($I$8="AIRBORNE ISOLATION",L17<=-0.01,OR(AND(M17="",L18=""),AND(M17="",L18<=-0.0001,(I18+J18)>0,F18="",G18=""),AND(M17="",L18<=-0.0001,(I18+J18)>0,(F18+G18)>0,(I18+J18)>(F18+G18),AND(M17<=-0.01,L18<=-0.0001,(I18+J18)>0,F18="",G18=""),AND(M17<=-0.01,L18<=-0.0001,(I18+J18)>0,(F18+G18)>0,(I18+J18)>(F18+G18))))),"",IF(AND($I$8="PROTECTIVE ENVIRONMENT",L17>=0.01,OR(AND(M17="",L18=""),AND(M17="",L18=0,(F18+G18)>0,I18="",J18=""),AND(M17="",L18<0,(I18+J18)>0,F18="",G18=""),AND(M17>=0.01,L18=0,(F18+G18)>0,I18="",J18=""),AND(M17>=0.01,L18<0,(I18+J18)>0,F18="",G18=""))),"",1)))

Haven't bothered figuring out where exactly the error is but this no longer gives you the error message.

Good luck!

That's it I think ;)
 
Upvote 0
It's very difficult to tell where your ANDs and ORs should end. As it stands the closing parenthesis for your first AND is right at the end. If you use the cursor to move over a parenthesis the other will flash/change colour. Use that as a guide.

If you are still stuck try to break the formula down into logical chunks using Alt+Enter.
 
Upvote 0
I think it was fine originally, it copied ok into Excel 2007 with no errors.
Strange??
 
Upvote 0
You're missing several parentheses. I made this version work; check to see if the logic is what you want it to be.

Code:
=IF(ISBLANK(B17), "",
   IF(
      AND($I$8="AIRBORNE ISOLATION", L17<=-0.01,
         OR(
            AND(M17="", L18=""),
            AND(M17="", L18<=-0.0001, (I18+J18)>0, F18="", G18=""),
            AND(M17="", L18<=-0.0001, (I18+J18)>0, (F18+G18)>0, (I18+J18)>(F18+G18),
               AND(M17<=-0.01,L18<=-0.0001, (I18+J18)>0, F18="", G18=""),
               AND(M17<=-0.01,L18<=-0.0001, (I18+J18)>0, (F18+G18)>0, (I18+J18)>(F18+G18))
            )
         )
      ), 
      "",
      IF(
         AND($I$8="PROTECTIVE ENVIRONMENT", L17>=0.01,
            OR(
               AND(M17="", L18=""),
               AND(M17="", L18=0, (F18+G18)>0, I18="", J18=""),
               AND(M17="", L18<0, (I18+J18)>0, F18="", G18=""),
               AND(M17>=0.01, L18=0, (F18+G18)>0, I18="", J18=""),
               AND(M17>=0.01, L18<0, (I18+J18)>0, F18="", G18="")
            )
         ),
         "",
         1
      )
   )
)
 
Last edited:
Upvote 0
Now I have a NEW problem.

First, the formula no longer returns and error. Thanks Steeviee and iliace for the solutions.

But, I am getting a value of 1 where the formula is pasted instead of an expected "" when there is a value in either cell F18 or G18...even though I18+J18 > F18+G18.

What I am missing here?
 
Upvote 0
Thanks for the help guys, but there are even more problems with my scenarios. No errors at this point but it is not returning the results i am expecting. I will do some more work on this side and re-post in this thread. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,214,829
Messages
6,121,826
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top