#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Data Validation

How can I do Data Entry Validation for all the cells in a column.

I want to make sure all entries a
1. Exactly two characters long.
2. Are all upper case.
3. Are only alpha-characters.
4. Are not duplicated (no two cells contain the same sequence of two
characters).

Dick King
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Data Validation

Hi Dick,

Select the column that you want to be validated.

Select Data-Validation (or Data-Data Validation if xl2007)

On Settings tab under Allow: Select custom

check the allow blank box.

Copy the following formula into the Formula box.

=AND(LEN(A1)=2,CODE(LEFT(A1,1))=65,CODE(LEFT(A1,1 ))<=90,CODE(RIGHT(A1,1))=65,CODE(RIGHT(A1,1))<=90 ,COUNTIF(A:A,A1)=1)

Note that the formula is one continuous line but will most likely be broken
with a line feed on this forum. You might have to copy it into Notepad and
remove the line feed. (I have not been able to edit them in the validation
formula box.) Also if your column is not column A then all the A1's plus A:A
in countif will have to be changed to your column.

Explanation:-
LEN(A1)=2 (ensures 2 characters long)
CODE(LEFT(A1,1))=65 and CODE(LEFT(A1,1))<=90 (ensures left character is
= uppercase A and <= to uppercase Z)


COUNTIF(A:A,A1)=1 (ensures only one entry in the column)


--
Regards,

OssieMac


"k1ngr" wrote:

How can I do Data Entry Validation for all the cells in a column.

I want to make sure all entries a
1. Exactly two characters long.
2. Are all upper case.
3. Are only alpha-characters.
4. Are not duplicated (no two cells contain the same sequence of two
characters).

Dick King

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Data Validation

It worked great.

Thanks,
Dick

"OssieMac" wrote:

Hi Dick,

Select the column that you want to be validated.

Select Data-Validation (or Data-Data Validation if xl2007)

On Settings tab under Allow: Select custom

check the allow blank box.

Copy the following formula into the Formula box.

=AND(LEN(A1)=2,CODE(LEFT(A1,1))=65,CODE(LEFT(A1,1 ))<=90,CODE(RIGHT(A1,1))=65,CODE(RIGHT(A1,1))<=90 ,COUNTIF(A:A,A1)=1)

Note that the formula is one continuous line but will most likely be broken
with a line feed on this forum. You might have to copy it into Notepad and
remove the line feed. (I have not been able to edit them in the validation
formula box.) Also if your column is not column A then all the A1's plus A:A
in countif will have to be changed to your column.

Explanation:-
LEN(A1)=2 (ensures 2 characters long)
CODE(LEFT(A1,1))=65 and CODE(LEFT(A1,1))<=90 (ensures left character is
= uppercase A and <= to uppercase Z)


COUNTIF(A:A,A1)=1 (ensures only one entry in the column)


--
Regards,

OssieMac


"k1ngr" wrote:

How can I do Data Entry Validation for all the cells in a column.

I want to make sure all entries a
1. Exactly two characters long.
2. Are all upper case.
3. Are only alpha-characters.
4. Are not duplicated (no two cells contain the same sequence of two
characters).

Dick King

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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
Data Validation Update Validation Selection PCreighton Excel Worksheet Functions 3 September 11th 07 03:32 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM


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