Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default If/Then Statement

The following works fine:
=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$8=8,O $8,IF(P$9=8,O$9,IF(P$10=8,O$10,IF(P$11=8,O$11,IF(P $14=8,O$14,0))))))))

But when I try to add one more section to it, I get an error and I can't
understand why.

I am trying to get
this:=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$ 8=8,O$8,IF(P$9=8,O$9,IF(P$10=8,O$10,IF(P$11=8,O$11 ,IF(P$14=8,O$14,IF(P$15=8,O$15,0)))))))))
but I continue to get an error.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default If/Then Statement

Excel versions prior to 2007 limit you to 7 nested IF()s.

how about this:

=IF(ISERROR(MATCH(8,P$5:P$11,0)),IF(P$14=8,O$14,0) ,INDEX(O$5:O$11,MATCH(8,P$5:P$11,0)))



"Kelli McCann" wrote:

The following works fine:
=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$8=8,O $8,IF(P$9=8,O$9,IF(P$10=8,O$10,IF(P$11=8,O$11,IF(P $14=8,O$14,0))))))))

But when I try to add one more section to it, I get an error and I can't
understand why.

I am trying to get
this:=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$ 8=8,O$8,IF(P$9=8,O$9,IF(P$10=8,O$10,IF(P$11=8,O$11 ,IF(P$14=8,O$14,IF(P$15=8,O$15,0)))))))))
but I continue to get an error.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default If/Then Statement

You've hi-jacked Karen's thread. There is a limit of 7 nested IFs in
Excel, which is what you have in your first formula. In your second
formula you are trying to add more and Excel will not allow you to.
You can get round this limitation with a different approach - try this
instead:

=VLOOKUP(8,P5:O15,2,0)

I see that there are no tests for P12 and P13, but as long as these do
not contain 8 then the formula will work okay. If you have more cells
to test beyond row 15, just change the O15 part to suit.

Hope this helps.

Pete

On Aug 14, 6:28 pm, Kelli McCann
wrote:
The following works fine:
=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$8=8,O $8,IF(P$9=8,O$9,IF(P$10=8*,O$10,IF(P$11=8,O$11,IF( P$14=8,O$14,0))))))))

But when I try to add one more section to it, I get an error and I can't
understand why.

I am trying to get
this:=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$ 8=8,O$8,IF(P$9=8,O$9,IF(P*$10=8,O$10,IF(P$11=8,O$1 1,IF(P$14=8,O$14,IF(P$15=8,O$15,0)))))))))
but I continue to get an error.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default If/Then Statement

Pete -

Unfortunately, the OP is matching the lookup value to column P and
retrieving the value in column O - the column to the LEFT - so VLOOKUP()
won't work.

"Pete_UK" wrote:

You've hi-jacked Karen's thread. There is a limit of 7 nested IFs in
Excel, which is what you have in your first formula. In your second
formula you are trying to add more and Excel will not allow you to.
You can get round this limitation with a different approach - try this
instead:

=VLOOKUP(8,P5:O15,2,0)

I see that there are no tests for P12 and P13, but as long as these do
not contain 8 then the formula will work okay. If you have more cells
to test beyond row 15, just change the O15 part to suit.

Hope this helps.

Pete

On Aug 14, 6:28 pm, Kelli McCann
wrote:
The following works fine:
=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$8=8,O $8,IF(P$9=8,O$9,IF(P$10=8-,O$10,IF(P$11=8,O$11,IF(P$14=8,O$14,0))))))))

But when I try to add one more section to it, I get an error and I can't
understand why.

I am trying to get
this:=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$ 8=8,O$8,IF(P$9=8,O$9,IF(P-$10=8,O$10,IF(P$11=8,O$11,IF(P$14=8,O$14,IF(P$15=8 ,O$15,0)))))))))
but I continue to get an error.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default If/Then Statement

Ah, right - well spotted, Duke.

Maybe one day I'll learn the alphabet !! <bg

Pete

On Aug 14, 7:16 pm, Duke Carey
wrote:
Pete -

Unfortunately, the OP is matching the lookup value to column P and
retrieving the value in column O - the column to the LEFT - so VLOOKUP()
won't work.



"Pete_UK" wrote:
You've hi-jacked Karen's thread. There is a limit of 7 nested IFs in
Excel, which is what you have in your first formula. In your second
formula you are trying to add more and Excel will not allow you to.
You can get round this limitation with a different approach - try this
instead:


=VLOOKUP(8,P5:O15,2,0)


I see that there are no tests for P12 and P13, but as long as these do
not contain 8 then the formula will work okay. If you have more cells
to test beyond row 15, just change the O15 part to suit.


Hope this helps.


Pete


On Aug 14, 6:28 pm, Kelli McCann
wrote:
The following works fine:
=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$8=8,O $8,IF(P$9=8,O$9,IF(P$10=8*-,O$10,IF(P$11=8,O$11,IF(P$14=8,O$14,0))))))))


But when I try to add one more section to it, I get an error and I can't
understand why.


I am trying to get
this:=IF(P$5=8,O$5,IF(P$6=8,O$6,IF(P$7=8,O$7,IF(P$ 8=8,O$8,IF(P$9=8,O$9,IF(P*-$10=8,O$10,IF(P$11=8,O$11,IF(P$14=8,O$14,IF(P$15=8 ,O$15,0)))))))))
but I continue to get an error.- Hide quoted text -


- Show quoted text -





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
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If Statement heater Excel Discussion (Misc queries) 2 August 15th 05 10:48 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 08:23 AM.

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"