It sounds like you want to use data validation.How do I format a cell to hold (only) 3 letters and 5 digits? Seems to me
this should work, but it does not.
@@@#####
Thank you tremendously!
Rita
It sounds like you want to use data validation.
What version of Excel are you using?
Ok, create these defined names:
=AND(LEN(A1)=8,ISTEXT(LEFT(A1,3)),ISNUMBER(--RIGHT(A1,5)))=TRUE
I don't think that'll work.assuming cell A1 then use data / validation / custom / formula
Quote:
<TABLE cellSpacing=0 cellPadding=6 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">=AND(LEN(A1)=8,ISTEXT(LEFT(A1,3)),ISNUMBER(--RIGHT(A1,5)))=TRUE </TD></TR></TBODY></TABLE>
Ok, create these defined names:
Goto the Formulas Tab>Defined Names>Define Name
Let's assume you want to apply this to cell A1.
- Name: Array1
- Refers to: ={1,2,3}
- Name: Array2
- Refers to: ={4,5,6,7,8}
- Name: Letters
- Refers to: ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Cell A1 will only accept entries where:
- Select cell A1
- Goto the Data tab>Data Validation
- Allow: Custom
- Formula: =AND(LEN(A1)=8,FIND(MID(A1,Array1,1),Letters),ISNUMBER(-MID(A1,Array2,1)))
- Uncheck: Ignore Blank
- OK out
- the total length must be 8 characters
- the first 3 characters must be uppercase letters A to Z
- the next 5 characters must be digits 0 to 9
Yeah, you could but using the array constants is more robust.Valko,
A suggestion: i think you can use ROW(1:3) instead of Array1 and ROW(4:8) instead of Array2
M.