A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can i run 2 IF statements in one formula?



 
 
Thread Tools Display Modes
  #1  
Old February 3rd, 2009, 04:12 PM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
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  
Old February 3rd, 2009, 04:27 PM posted to microsoft.public.excel.worksheet.functions
Pete_UK
external usenet poster
 
Posts: 8,780
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  
Old February 3rd, 2009, 04:39 PM posted to microsoft.public.excel.worksheet.functions
John Bundy
external usenet poster
 
Posts: 455
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  
Old February 3rd, 2009, 05:16 PM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:41 PM.


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