Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
Looking for help to validate a single cell to an alphanumeric entry that is
exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
This works for alpha being upper case *only*:
=AND(LEN(A1)=6,ISNUMBER(--RIGHT(A1,5)),CODE(A1)=65,CODE(A1)<=90) To accept upper *or* lower case alpha: =AND(LEN(A1)=6,ISNUMBER(--RIGHT(A1,5)), OR(AND(CODE(A1)=65,CODE(A1)<=90),AND(CODE(A1)=97 ,CODE(A1)<=122))) -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
This works based on the following conditions:
Length must be 6 characters The 1st character must be upper case A-Z Chars 2 through 6 must be numbers 0-9 =AND(LEN(A1)=6,CODE(LEFT(A1))=65,CODE(LEFT(A1))<= 90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) -- Biff Microsoft Excel MVP "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
ISNUMBER(--RIGHT(A1,5))
That will accept the following: A1 = X1.234 A1 = X-1234 A1 = X123E1 -- Biff Microsoft Excel MVP "RagDyer" wrote in message ... This works for alpha being upper case *only*: =AND(LEN(A1)=6,ISNUMBER(--RIGHT(A1,5)),CODE(A1)=65,CODE(A1)<=90) To accept upper *or* lower case alpha: =AND(LEN(A1)=6,ISNUMBER(--RIGHT(A1,5)), OR(AND(CODE(A1)=65,CODE(A1)<=90),AND(CODE(A1)=97 ,CODE(A1)<=122))) -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
Code() doesn't really need Left().
Besides, can't get your formula to accept: A12345 -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "T. Valko" wrote in message ... This works based on the following conditions: Length must be 6 characters The 1st character must be upper case A-Z Chars 2 through 6 must be numbers 0-9 =AND(LEN(A1)=6,CODE(LEFT(A1))=65,CODE(LEFT(A1))<= 90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) -- Biff Microsoft Excel MVP "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
You're right ... stupid of me!
Neat formula.<g -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "T. Valko" wrote in message ... Code() doesn't really need Left(). Yeah, that'll save a few keystrokes. =AND(LEN(A1)=6,CODE(A1)=65,CODE(A1)<=90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) can't get your formula to accept: A12345 If you're testing it as a worksheet formula it has to be array entered. -- Biff Microsoft Excel MVP "RagDyer" wrote in message ... Code() doesn't really need Left(). Besides, can't get your formula to accept: A12345 -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "T. Valko" wrote in message ... This works based on the following conditions: Length must be 6 characters The 1st character must be upper case A-Z Chars 2 through 6 must be numbers 0-9 =AND(LEN(A1)=6,CODE(LEFT(A1))=65,CODE(LEFT(A1))<= 90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) -- Biff Microsoft Excel MVP "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
On Fri, 25 Apr 2008 08:52:00 -0700, Dan wrote:
Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. =AND(LEN(A1)=6,CODE(A1)=65,CODE(A1)<=90,ISNUMBER(-MID(A1,{2,3,4,5,6},1))) if the first letter must be capitalized. If it can be upper or lower case, then: =AND(LEN(A1)=6,OR(AND(CODE(A1)=65,CODE(A1)<=90),A ND(CODE(A1)=97,CODE(A1)<=122)), ISNUMBER(-MID(A1,{2,3,4,5,6},1))) --ron |
#8
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
"Ron Rosenfeld" wrote in message
... On Fri, 25 Apr 2008 08:52:00 -0700, Dan wrote: Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. =AND(LEN(A1)=6,CODE(A1)=65,CODE(A1)<=90,ISNUMBER(-MID(A1,{2,3,4,5,6},1))) if the first letter must be capitalized. If it can be upper or lower case, then: =AND(LEN(A1)=6,OR(AND(CODE(A1)=65,CODE(A1)<=90),A ND(CODE(A1)=97,CODE(A1)<=122)), ISNUMBER(-MID(A1,{2,3,4,5,6},1))) --ron If the OP's intention is to use this as a DataValidation rule (which is my interpretation) you can't use formulas with array constants. -- Biff Microsoft Excel MVP |
#9
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
On Fri, 25 Apr 2008 21:58:51 -0400, "T. Valko" wrote:
If the OP's intention is to use this as a DataValidation rule (which is my interpretation) you can't use formulas with array constants. Good point. I did not consider that. --ron |
#10
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
Perfect! Thank you very much.
-- Dan "T. Valko" wrote: Code() doesn't really need Left(). Yeah, that'll save a few keystrokes. =AND(LEN(A1)=6,CODE(A1)=65,CODE(A1)<=90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) can't get your formula to accept: A12345 If you're testing it as a worksheet formula it has to be array entered. -- Biff Microsoft Excel MVP "RagDyer" wrote in message ... Code() doesn't really need Left(). Besides, can't get your formula to accept: A12345 -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "T. Valko" wrote in message ... This works based on the following conditions: Length must be 6 characters The 1st character must be upper case A-Z Chars 2 through 6 must be numbers 0-9 =AND(LEN(A1)=6,CODE(LEFT(A1))=65,CODE(LEFT(A1))<= 90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) -- Biff Microsoft Excel MVP "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
#11
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Alphanumeric limitation
You're welcome. Thanks for the feedback!
-- Biff Microsoft Excel MVP "Dan" wrote in message ... Perfect! Thank you very much. -- Dan "T. Valko" wrote: Code() doesn't really need Left(). Yeah, that'll save a few keystrokes. =AND(LEN(A1)=6,CODE(A1)=65,CODE(A1)<=90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) can't get your formula to accept: A12345 If you're testing it as a worksheet formula it has to be array entered. -- Biff Microsoft Excel MVP "RagDyer" wrote in message ... Code() doesn't really need Left(). Besides, can't get your formula to accept: A12345 -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "T. Valko" wrote in message ... This works based on the following conditions: Length must be 6 characters The 1st character must be upper case A-Z Chars 2 through 6 must be numbers 0-9 =AND(LEN(A1)=6,CODE(LEFT(A1))=65,CODE(LEFT(A1))<= 90,COUNT(-MID(A1,ROW(INDIRECT("2:6")),1))=5) -- Biff Microsoft Excel MVP "Dan" wrote in message ... Looking for help to validate a single cell to an alphanumeric entry that is exacly 6 characters in length with the first character required to be a letter and the remaining characters to be numbers. Exp: A00142 orT10001, ect. -- Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If function limitation | Excel Worksheet Functions | |||
Row Limitation | Excel Discussion (Misc queries) | |||
Way around row limitation | Excel Discussion (Misc queries) | |||
vlookup limitation | Excel Discussion (Misc queries) | |||
fix for worksheet limitation | Excel Discussion (Misc queries) |