Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Zak Zak is offline
external usenet poster
 
Posts: 144
Default Can i run 2 IF statements in one formula?

I have a column which can contain only numbers and can only be up to 4 digits
long. Is there an IF statement I can write to check for these 2 conditions?

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Can i run 2 IF statements in one formula?

Something like this:

=IF(AND(ISNUMBER(A1),LEN(A1)<=4),"okay","wrong")

Copy down as required.

Hope this helps.

Pete

On Feb 3, 4:12*pm, zak wrote:
I have a column which can contain only numbers and can only be up to 4 digits
long. *Is there an IF statement I can write to check for these 2 conditions?

Thanks in advance


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 772
Default Can i run 2 IF statements in one formula?

you can, yes, but you might like validation better. Go to Data-Validation
and choose Custom, enter this formula substituting A1 as necessary
=AND(LEN(A1)=4,ISNUMBER(A1)=TRUE)
You can also have an input message telling them what is required and a
custom error message that tells them the rules.

--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"zak" wrote:

I have a column which can contain only numbers and can only be up to 4 digits
long. Is there an IF statement I can write to check for these 2 conditions?

Thanks in advance

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Can i run 2 IF statements in one formula?

You can omit the =TRUE
And you probably need <=4, rather than =4
--
David Biddulph

"John Bundy" (remove) wrote in message
...
you can, yes, but you might like validation better. Go to Data-Validation
and choose Custom, enter this formula substituting A1 as necessary
=AND(LEN(A1)=4,ISNUMBER(A1)=TRUE)
You can also have an input message telling them what is required and a
custom error message that tells them the rules.

--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"zak" wrote:

I have a column which can contain only numbers and can only be up to 4
digits
long. Is there an IF statement I can write to check for these 2
conditions?

Thanks in advance



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
Fiveif statements in a formula BillS Excel Worksheet Functions 1 July 20th 06 04:43 AM
HOW MANY IF STATEMENTS CAN YOU HAVE IN ONE FORMULA? bvehslage Excel Discussion (Misc queries) 2 May 17th 06 07:57 PM
If, Then statements with a formula Michelle Excel Discussion (Misc queries) 1 January 24th 06 02:04 PM
Can I create a formula with more than 8 IF statements? Paul P Excel Discussion (Misc queries) 2 January 17th 06 12:08 PM
IF statements/formula problem Admiral70 Excel Worksheet Functions 15 August 23rd 05 09:34 PM


All times are GMT +1. The time now is 01:39 AM.

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"