LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Data validation problem

Hi, I'm having dificulties fitting the formula in data validation.

The condition should be :

1. A-TFG-1234(a or ab)
2. B-TFG-1234(a or ab)
or
3. ABC1234 - (TFG1234 is not allowed)

Note:

For No.1 and No. 2 :
"A-TFG-" or " "B-TFG-" is mandatory.
1234 is numeric only
(a or ab) any alphabets (lowercase or uppercase are allowed)
minimum 10 character, maximum 12 character
sample : A-TFG-4675, B-TFG-6544KL or B-TFG2344G


For No. 3
ABC is (a|A..z|Z only) but TFG is not allowed
1234 is a number
max 7 character
sample : BTU3456, wrt2231
sample : TFG2245 (is not allowed)


Below is my code:

=OR(AND(OR(LEFT(C10,6)="A-TFG-",LEFT(C10,6)="B-TFG-"),ISNUMBER(MID(C10,7,4)*1),AND(LEN(C10)=10,NOT(I SNUMBER(MID(C10,11,1)*1)))),(AND(ISNUMBER(RIGHT(C1 0,4)*1),NOT(ISNUMBER(LEFT(C10,1)*1)),NOT(ISNUMBER( MID(C10,3,1)*1)),LEN(C10)=7,LEFT(C10,3)<"TFG")))

still not cover everything due to the lack of space.

Anybody can simplify this code?
Please help.

Thank you

 
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
Data Validation Problem Few more questions[_2_] Excel Discussion (Misc queries) 1 February 20th 07 09:38 PM
Problem with Data Validation Joseph Bowen Excel Discussion (Misc queries) 1 October 11th 06 09:14 PM
Problem with Data Validation Joseph Bowen Excel Discussion (Misc queries) 0 October 11th 06 02:53 PM
Data validation problem Peter1999 Excel Discussion (Misc queries) 3 May 22nd 06 09:18 AM
Data Validation problem. DaveO Excel Discussion (Misc queries) 1 October 24th 05 03:15 PM


All times are GMT +1. The time now is 05:19 PM.

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"