Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default if statement for number of digits

I need help writing an if statement. I would like to say:

If(A1 = a 4 digit number,"UNAPPROVED","")

How do I designate the 4 digit number in the formula?

Also, for another statement, I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".

Thanks,Pam
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 89
Default if statement for number of digits

=if(a1999,"Unapproved","")

Irie



"Pam M" wrote:

I need help writing an if statement. I would like to say:

If(A1 = a 4 digit number,"UNAPPROVED","")

How do I designate the 4 digit number in the formula?

Also, for another statement, I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".

Thanks,Pam

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 89
Default if statement for number of digits

2nd question:

=if(or(a1=4,a1=5,a1=6,a1-9),"unapproved","")

Irie



"Pam M" wrote:

I need help writing an if statement. I would like to say:

If(A1 = a 4 digit number,"UNAPPROVED","")

How do I designate the 4 digit number in the formula?

Also, for another statement, I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".

Thanks,Pam

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default if statement for number of digits


Try these

=IF(Len(A1)=4,"Unapproved","")

=IF(OR(Left(A1)+0={4,5,6,9}),"","Unapproved")


--
NBVC

Where there is a will there are many ways.
'The Code Cage' (http;//www.thecodecage.com)
------------------------------------------------------------------------
NBVC's Profile: http://www.thecodecage.com/forumz/member.php?userid=74
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=122317

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 89
Default if statement for number of digits

Should say:

=if(or(a1=4,a1=5,a1=6,a1=9),"unapproved","")

"Iriemon" wrote:

2nd question:

=if(or(a1=4,a1=5,a1=6,a1-9),"unapproved","")

Irie



"Pam M" wrote:

I need help writing an if statement. I would like to say:

If(A1 = a 4 digit number,"UNAPPROVED","")

How do I designate the 4 digit number in the formula?

Also, for another statement, I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".

Thanks,Pam



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default if statement for number of digits

Shouldnt that be

=IF(ISNA(MATCH(LEFT(A1,1),{"4","5","6","9"},0)),"" ,"UnApproved")

since the OP has asked for ""I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".""""



If this post helps click Yes
---------------
Jacob Skaria


"Iriemon" wrote:

2nd question:

=if(or(a1=4,a1=5,a1=6,a1-9),"unapproved","")

Irie



"Pam M" wrote:

I need help writing an if statement. I would like to say:

If(A1 = a 4 digit number,"UNAPPROVED","")

How do I designate the 4 digit number in the formula?

Also, for another statement, I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".

Thanks,Pam

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default if statement for number of digits

Both of these items worked perfectly, and were the most concise of the
choices. thank you all for your help, Pam

"NBVC" wrote:


Try these

=IF(Len(A1)=4,"Unapproved","")

=IF(OR(Left(A1)+0={4,5,6,9}),"","Unapproved")


--
NBVC

Where there is a will there are many ways.
'The Code Cage' (http;//www.thecodecage.com)
------------------------------------------------------------------------
NBVC's Profile: http://www.thecodecage.com/forumz/member.php?userid=74
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=122317


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
How many number digits can I fit into one cell? HoppoM Excel Discussion (Misc queries) 3 August 13th 09 05:51 PM
Sum of digits in a number Bob Ptacek Excel Worksheet Functions 3 January 8th 08 12:49 AM
How to customize number to 10 digits including 2 digits after deci Carina Excel Worksheet Functions 3 September 20th 07 02:50 AM
How do I find the sum of all digits in a number? monkeyforce5 Excel Discussion (Misc queries) 4 September 9th 05 09:49 PM
help with removing digits from a number frank Excel Discussion (Misc queries) 4 July 12th 05 02:31 AM


All times are GMT +1. The time now is 04:35 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"