Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
KeLee
 
Posts: n/a
Default Have I exceeded nesting limit

Excuse the gargantuan formula.

In Excel 2003 I am comparing product groupings and prices of groupings to
maximize profitabillity on bundle sizes for products.

I have test data that is FALSE, FALSE, TRUE for the nested IF's.

However, my result is adding the TRUE and FALSE values together for the
third IF statement, and appearing to me to ignore the comma delimiting where
the fasle statement begins.

=IF(AND($D$20=1,$D$22=1),$J3,IF($D$20=1,$J3+VLOOKU P(INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tables!$C $11:$C$16)+10,3)),Tables!$C$11:$K$16,9),IF($D$22=1 ,$J3+VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$2 1,Tables!$C$2:$C$7)+1,3)),Tables!$C$2:$K$7,9),$J3+ VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$21,Tab les!$C$2:$C$7)+1,3)),Tables!$C$2:$K$7,9))+VLOOKUP( INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tables!$C$1 1:$C$16)+10,3)),Tables!$C$11:$K$16,9)))

IS this due to more than 7 levels of nesting? I'm not sure where to reset
the count. I think I have only 7 in each statement if it is followed from the
first IF.

IF it helps, my test data has:
$D$20 = 2 (User input cell)
$D$21 = 5 (Chosen by formula reference to external cells based on $D$20)
$D$22 = 1 (User input cell)
$D$23 = 1 (Chosen by formula reference to external cell based on $D$22)

Therefore I expect it to resolve to the following:

IF($D$22=1,$J3+VLOOKUP(INDIRECT("Tables!"&ADDRESS( MATCH($D$21,Tables!$C$2:$C$7)+1,3)),Tables!$C$2:$K $7,9)

$J3 = 255
The resultant lookup value is 100

To give 355

But my result is adding in the result of the next lookup after the comma to
add on an extra unwanted 35 and an incorrect total of 390.

I have evaluated the formula and it calculates it correctly to
IF(TRUE,255+100,......)

But still goes on to add in the rest.

I realise this is probably far too specific and convoluted to realisticaally
expect anyone to wade through it, but I'd sure appreciate any help that's on
offer.

My thanks and appreciation if you even finished reading the entire post!

KeLee
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

For starters, I would change the parts of your formula like:

VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tab les!$C$11:$C$16)+10,3)),Tables!$C$11:$K$16,9

to

VLOOKUP($D$23,Tables!$C$11:$K$16,9)

HTH,
Bernie
MS Excel MVP


"KeLee" wrote in message
...
Excuse the gargantuan formula.

In Excel 2003 I am comparing product groupings and prices of groupings to
maximize profitabillity on bundle sizes for products.

I have test data that is FALSE, FALSE, TRUE for the nested IF's.

However, my result is adding the TRUE and FALSE values together for the
third IF statement, and appearing to me to ignore the comma delimiting where
the fasle statement begins.

=IF(AND($D$20=1,$D$22=1),$J3,IF($D$20=1,$J3+VLOOKU P(INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tables!$C $11:$C$16)+10,3)),Tables!$C$11:$K$16,9),IF($D$22=1 ,$J3+VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$2 1,Tables!$C$2:$C$7)+1,3)),Tables!$C$2:$K$7,9),$J3+ VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$21,Tab les!$C$2:$C$7)+1,3)),Tables!$C$2:$K$7,9))+VLOOKUP( INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tables!$C$1 1:$C$16)+10,3)),Tables!$C$11:$K$16,9)))

IS this due to more than 7 levels of nesting? I'm not sure where to reset
the count. I think I have only 7 in each statement if it is followed from the
first IF.

IF it helps, my test data has:
$D$20 = 2 (User input cell)
$D$21 = 5 (Chosen by formula reference to external cells based on $D$20)
$D$22 = 1 (User input cell)
$D$23 = 1 (Chosen by formula reference to external cell based on $D$22)

Therefore I expect it to resolve to the following:

IF($D$22=1,$J3+VLOOKUP(INDIRECT("Tables!"&ADDRESS( MATCH($D$21,Tables!$C$2:$C$7)+1,3)),Tables!$C$2:$K $7,9)

$J3 = 255
The resultant lookup value is 100

To give 355

But my result is adding in the result of the next lookup after the comma to
add on an extra unwanted 35 and an incorrect total of 390.

I have evaluated the formula and it calculates it correctly to
IF(TRUE,255+100,......)

But still goes on to add in the rest.

I realise this is probably far too specific and convoluted to realisticaally
expect anyone to wade through it, but I'd sure appreciate any help that's on
offer.

My thanks and appreciation if you even finished reading the entire post!

KeLee



  #3   Report Post  
KeLee
 
Posts: n/a
Default

Thanks very much, this leaves me with
=IF(AND($D$20=1,$D$22=1),$J3,IF($D$20=1,$J3+VLOOKU P($D$23,Tables!$C$11:$K$16,9),IF($D$22=1,$J3+VLOOK UP($D$21,Tables!$C$2:$K$7,9),$J3+VLOOKUP($D$21,Tab les!$C$2:$K$7,9)+VLOOKUP($D$23,Tables!$C$11:$K$16, 9))))

Then i can see that one of my loookup ranges was the MATCH range and not the
VLOOKUP range, I have stored the INDIRECTCell addresses with separate
formulas elsewhere to use in another part of the calculation

Thanks again for letting me seort the wood from the trees
KeLee

"Bernie Deitrick" wrote:

For starters, I would change the parts of your formula like:

VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tab les!$C$11:$C$16)+10,3)),Tables!$C$11:$K$16,9

to

VLOOKUP($D$23,Tables!$C$11:$K$16,9)

HTH,
Bernie
MS Excel MVP


"KeLee" wrote in message
...
Excuse the gargantuan formula.

In Excel 2003 I am comparing product groupings and prices of groupings to
maximize profitabillity on bundle sizes for products.

I have test data that is FALSE, FALSE, TRUE for the nested IF's.

However, my result is adding the TRUE and FALSE values together for the
third IF statement, and appearing to me to ignore the comma delimiting where
the fasle statement begins.

=IF(AND($D$20=1,$D$22=1),$J3,IF($D$20=1,$J3+VLOOKU P(INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tables!$C $11:$C$16)+10,3)),Tables!$C$11:$K$16,9),IF($D$22=1 ,$J3+VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$2 1,Tables!$C$2:$C$7)+1,3)),Tables!$C$2:$K$7,9),$J3+ VLOOKUP(INDIRECT("Tables!"&ADDRESS(MATCH($D$21,Tab les!$C$2:$C$7)+1,3)),Tables!$C$2:$K$7,9))+VLOOKUP( INDIRECT("Tables!"&ADDRESS(MATCH($D$23,Tables!$C$1 1:$C$16)+10,3)),Tables!$C$11:$K$16,9)))

IS this due to more than 7 levels of nesting? I'm not sure where to reset
the count. I think I have only 7 in each statement if it is followed from the
first IF.

IF it helps, my test data has:
$D$20 = 2 (User input cell)
$D$21 = 5 (Chosen by formula reference to external cells based on $D$20)
$D$22 = 1 (User input cell)
$D$23 = 1 (Chosen by formula reference to external cell based on $D$22)

Therefore I expect it to resolve to the following:

IF($D$22=1,$J3+VLOOKUP(INDIRECT("Tables!"&ADDRESS( MATCH($D$21,Tables!$C$2:$C$7)+1,3)),Tables!$C$2:$K $7,9)

$J3 = 255
The resultant lookup value is 100

To give 355

But my result is adding in the result of the next lookup after the comma to
add on an extra unwanted 35 and an incorrect total of 390.

I have evaluated the formula and it calculates it correctly to
IF(TRUE,255+100,......)

But still goes on to add in the rest.

I realise this is probably far too specific and convoluted to realisticaally
expect anyone to wade through it, but I'd sure appreciate any help that's on
offer.

My thanks and appreciation if you even finished reading the entire post!

KeLee




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit to the number of items in a cell Jim_Bowie Excel Worksheet Functions 2 June 22nd 05 06:33 PM
How do I add a limit line to a chart, so I can see where a data p. Patrick question on chart reference Charts and Charting in Excel 1 March 11th 05 12:56 AM
How do I limit the number of complete sentences in a spreadsheet c sbernard Excel Worksheet Functions 1 February 13th 05 05:26 AM
Employing constant arrays to limit nested IF statements. Richard-44 Excel Worksheet Functions 2 January 6th 05 02:19 AM
Any way to get around the 240-character line limit on text output? awp Excel Discussion (Misc queries) 3 December 14th 04 11:59 PM


All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"