help with a nested formula

P

Pamela

Hi. Can anyone out there help me with this formula. I keep getting a
message that a parenthesis is missing but I just can't figure out
where. when I use the formula helper I see no errors within the
logical arguments or values. Thanks for your help!

=IF(AND(c396>=140,f396>0,I396>0,J396<=0),SUM(F396,I396,J396),"",
IF(AND(c396>=140,f396<=0,I396>0,J396<=0),sum(f396,I396,J396),"",
IF(AND(c396>=80<140,f396>0,I396<=0,j396<=0),SUM(f396,j396),"",
IF(AND(c396>=80<140,f396<=0,I396<=0,J396<=0),"","",
IF(AND(c396<80,f396>=0,j396<=0,J396<=0),f396,"")
 
B

Bernard REY

Pamela wrote :
Hi. Can anyone out there help me with this formula. I keep getting a
message that a parenthesis is missing but I just can't figure out
where. when I use the formula helper I see no errors within the
logical arguments or values. Thanks for your help!

=IF(AND(c396>=140,f396>0,I396>0,J396<=0),SUM(F396,I396,J396),"",
IF(AND(c396>=140,f396<=0,I396>0,J396<=0),sum(f396,I396,J396),"",
IF(AND(c396>=80<140,f396>0,I396<=0,j396<=0),SUM(f396,j396),"",
IF(AND(c396>=80<140,f396<=0,I396<=0,J396<=0),"","",
IF(AND(c396<80,f396>=0,j396<=0,J396<=0),f396,"")

There's more than one parenthesis missing! If you edit your formula and add
one parenthesis at the end, you should see its corresponding opening
parenthesis bolded. So you just have to add them until you see the very
first one bolded. This is how your formula should come up:

=IF(AND(c396>=140,f396>0,I396>0,J396<=0),SUM(F396,I396,J396),"",
IF(AND(c396>=140,f396<=0,I396>0,J396<=0),SUM(f396,I396,J396),"",
IF(AND(c396>=80<140,f396>0,I396<=0,j396<=0),SUM(f396,j396),"",
IF(AND(c396>=80<140,f396<=0,I396<=0,J396<=0),"","",
IF(AND(c396<80,f396>=0,j396<=0,J396<=0),f396,"")))))
 
J

J.E. McGimpsey

Bernard REY said:
There's more than one parenthesis missing! If you edit your formula and add
one parenthesis at the end, you should see its corresponding opening
parenthesis bolded. So you just have to add them until you see the very
first one bolded. This is how your formula should come up:

=IF(AND(c396>=140,f396>0,I396>0,J396<=0),SUM(F396,I396,J396),"",
IF(AND(c396>=140,f396<=0,I396>0,J396<=0),SUM(f396,I396,J396),"",
IF(AND(c396>=80<140,f396>0,I396<=0,j396<=0),SUM(f396,j396),"",
IF(AND(c396>=80<140,f396<=0,I396<=0,J396<=0),"","",
IF(AND(c396<80,f396>=0,j396<=0,J396<=0),f396,"")))))

You also have some errors in the formula. Each IF() can only have
one TRUE and one FALSE Branch (either of which can be another IF()
statement). Also, your

C396>=80<140


will compare C396 to TRUE (i.e., 80<140), not return TRUE if
80<=C396<140. The result of that comparison will *always* be false.

I can't tell exactly, but this may be more what you're looking for:

=IF(AND(C396>=140,F396>0,I396>0,J396<=0), SUM(F396,I396,J396),
IF(AND(C396>=140,F396<=0,I396>0,J396<=0), SUM(F396,I396,J396),
IF(AND(C396>=80,C396<140,F396>0,I396<=0,J396<=0), SUM(F396,J396),
IF(AND(C396>=80,C396<140,F396<=0,I396<=0,J396<=0), "",
IF(AND(C396<80,F396>=0,J396<=0,J396<=0), F396, "")))))
 
P

Pamela

Bernard REY said:
Pamela wrote :


There's more than one parenthesis missing! If you edit your formula and add
one parenthesis at the end, you should see its corresponding opening
parenthesis bolded. So you just have to add them until you see the very
first one bolded. This is how your formula should come up:

=IF(AND(c396>=140,f396>0,I396>0,J396<=0),SUM(F396,I396,J396),"",
IF(AND(c396>=140,f396<=0,I396>0,J396<=0),SUM(f396,I396,J396),"",
IF(AND(c396>=80<140,f396>0,I396<=0,j396<=0),SUM(f396,j396),"",
IF(AND(c396>=80<140,f396<=0,I396<=0,J396<=0),"","",
IF(AND(c396<80,f396>=0,j396<=0,J396<=0),f396,"")))))

thank you! When I get all opening and closing parens matching I get a
message there is an error in the formula. any tips on how to track it
down appreciated!
 
B

Bernard Rey

Pamela wrote :
thank you! When I get all opening and closing parens
matching I get a message there is an error in the
formula. Any tips on how to track it down appreciated!

Sorry for this, I haven't had a look at the formula itself
(you know, morning hurry...) Have a look at J.E.
McGimpsey's reply. It'll give you more than a clue to what
you should modify.

But, as you don't give much indication about what you want
to do, it is possible that it still doesn't exactly match
your requirements.
 

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