Can i run 2 IF statements in one formula?

Z

zak

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
 
P

Pete_UK

Something like this:

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

Copy down as required.

Hope this helps.

Pete
 
J

John Bundy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top