#1   Report Post  
rmitchell87
 
Posts: n/a
Default Long IF Statement

I am trying to write an IF statement to look for a number in either one row
or columb and then return a value if the statement is true. I am able to get
everything to work until I try putting in my ninth IF statement and then I
get a message that tells me I am trying something wrong. Are you only
allowed to have eight nested statements? Here is an example of what I can
get to work:

=IF(A1=1,"",IF(A2=1,"",IF(A3=1,"",IF(A4=1,"",IF(A5 =1,"",IF(A6=1,"",IF(A7=1,"",IF(A8=1,"",1))))))))

I would really like get that ninth IF in their, or is their another way of
doing this?

I checked out the vlookup and lookup statements, and either I don't know
what or how to write them, or they just aren't what I am looking for.

Thank you for any help on this.

ROD
  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

=IF(ISNUMBER(MATCH(1,A1:A9,0)),"",1)

You can only nest 7 levels. That means the top level plus 7 for a total of
8.

Biff

"rmitchell87" wrote in message
...
I am trying to write an IF statement to look for a number in either one row
or columb and then return a value if the statement is true. I am able to
get
everything to work until I try putting in my ninth IF statement and then I
get a message that tells me I am trying something wrong. Are you only
allowed to have eight nested statements? Here is an example of what I can
get to work:

=IF(A1=1,"",IF(A2=1,"",IF(A3=1,"",IF(A4=1,"",IF(A5 =1,"",IF(A6=1,"",IF(A7=1,"",IF(A8=1,"",1))))))))

I would really like get that ninth IF in their, or is their another way of
doing this?

I checked out the vlookup and lookup statements, and either I don't know
what or how to write them, or they just aren't what I am looking for.

Thank you for any help on this.

ROD



  #3   Report Post  
Max
 
Posts: n/a
Default

In this instance, one play is to use:

=IF(SUMPRODUCT(--(A1:A8=1))=0,1,"")

(normal ENTER will do)

Just extend the range covered to suit,
e.g. to cover the range A1:A20, put in say, B1:

=IF(SUMPRODUCT(--(A1:A20=1))=0,1,"")

But do note that we can't use entire col references
(e.g.: A:A, B:B, etc) in SUMPRODUCT
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"rmitchell87" wrote in message
...
I am trying to write an IF statement to look for a number in either one

row
or columb and then return a value if the statement is true. I am able to

get
everything to work until I try putting in my ninth IF statement and then I
get a message that tells me I am trying something wrong. Are you only
allowed to have eight nested statements? Here is an example of what I can
get to work:


=IF(A1=1,"",IF(A2=1,"",IF(A3=1,"",IF(A4=1,"",IF(A5 =1,"",IF(A6=1,"",IF(A7=1,"
",IF(A8=1,"",1))))))))

I would really like get that ninth IF in their, or is their another way of
doing this?

I checked out the vlookup and lookup statements, and either I don't know
what or how to write them, or they just aren't what I am looking for.

Thank you for any help on this.

ROD



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
more than 3 conditions in conditional formatting - possible? rob curtis Excel Discussion (Misc queries) 11 August 17th 05 04:02 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
macro to run series of reports to PDF Marc Bobrow Excel Worksheet Functions 5 May 13th 05 02:39 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 08:53 PM.

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

About Us

"It's about Microsoft Excel"