Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default checking a Cells contents

How about:

=IF(AND(LEN(A1)=9,ISNUMBER(-REPLACE(A1,3,1,"")),CODE(UPPER(MID(A1,3,1)))64,
CODE(UPPER(MID(A1,3,1)<96))),"Valid Order","not Valid")

(all one cell)

antinoz wrote:

I'm trying to validate data in a column of cells to check that the format is
"NNANNNNNN" (N= number A= Alpha I have) all the cell contents are different
but have 9 characters containing the alphanumeric format as shown

I want to put it in an If statement:

so if cell A1 = mask "NNANNNNNNN" cell A2 = "Valid order"


--

Dave Peterson

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default checking a Cells contents

I like this better:

=IF(LEN(A1)<9,"not Valid",
IF(NOT(ISNUMBER(-REPLACE(A1,3,1,""))),"not Valid",
IF(AND(TEXT(--REPLACE(A1,3,1,""),"00000000")=REPLACE(A1,3,1,""),
CODE(UPPER(MID(A1,3,1)))64,CODE(UPPER(MID(A1,3,1) <96))),
"Valid Order","not Valid")))

It removes any error if the length was too short and checks for entries like:
12A1234E7
(E can make it look like the entry was using scientific notation)


Dave Peterson wrote:

How about:

=IF(AND(LEN(A1)=9,ISNUMBER(-REPLACE(A1,3,1,"")),CODE(UPPER(MID(A1,3,1)))64,
CODE(UPPER(MID(A1,3,1)<96))),"Valid Order","not Valid")

(all one cell)

antinoz wrote:

I'm trying to validate data in a column of cells to check that the format is
"NNANNNNNN" (N= number A= Alpha I have) all the cell contents are different
but have 9 characters containing the alphanumeric format as shown

I want to put it in an If statement:

so if cell A1 = mask "NNANNNNNNN" cell A2 = "Valid order"


--

Dave Peterson


--

Dave Peterson

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
Checking the length of cell contents RichardG Excel Discussion (Misc queries) 8 February 21st 06 12:37 PM
checking a Cells contents Bob Kilmer Excel Programming 0 September 9th 04 03:02 AM
Auto-checking a checkbox based on cell contents. Ramon Cantu Jr. Excel Programming 2 May 27th 04 02:18 AM
Checking contents Edgar Thoemmes Excel Programming 4 February 9th 04 02:01 AM
Checking contents Edgar Thoemmes[_2_] Excel Programming 5 February 3rd 04 02:56 PM


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