View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Apparently exceeds max formula length?

excel will only accept up to 7 nested if statements
I would think about a vlookup() or similar method
for example you could have something like in a4
=--(Sheet2!A2)
in B4
=Sheet1!G3*Sheet1!E2
in A5
=--(Sheet2!b2)
IN b5
=Sheet1!G3*Sheet1!E3

ETC
then the equation could be
=if(G3<0,"u.i less than zero",vllookup(1,A4:B20,2)

"BudW" wrote:

Hi,

I have an equation I'm trying to put in excel 2003. It is currently:

=IF(G3<0,"u.i less than
zero",IF(Sheet2!$A2=TRUE,Sheet1!$G3*Sheet1!$E$2,IF (Sheet2!$B2=TRUE,Sheet1!$G3*Sheet1!$E$3,IF(Sheet2! $C2=TRUE,Sheet1!$G3*Sheet1!$E$4,IF(Sheet2!$D2=TRUE ,Sheet1!$G3*Sheet1!$E$4,IF(Sheet2!$E2=TRUE,Sheet1! $G3*Sheet1!$E$5,IF(Sheet2!$F2=TRUE,Sheet1!$G3*Shee t1!$E$6,IF(Sheet2!$G2=TRUE,Sheet1!$G3*Sheet1!$E$7, "unknown"))))))))

The problem is that I need to include about 3 or 4 more IF statements
similar to the ones already in the equation. When I include one more if
statement I get an error that says there is a mistake in my formula when I
hit "OK" it highlights the latest "IF" as if there were some problem with it.
I can detect no problem.

I have noticed that in the last IF statement excel no-longer assigns a color
to the cell showing which cell you are referring to.

Could someone please tell me if I'm exceeding the max limit. Or any other
suggestions to get around this problem.

Related topic: I did have all the work in the main formula rather than
having the formula sub calculations occuring in sheet two. I ran into the
same problem. I had hoped that splitting the sub calculations out of the
original formula would help (it didn't)

Thanks in advance,
BudW