ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Validation on cell (https://www.excelbanter.com/excel-worksheet-functions/200581-validation-cell.html)

dalymjl

Validation on cell
 
Is it possible to apply a validation to a cell to allow only a 7 digit number followed by any letter from A to W e.g 1234567T?

dan dungan

Validation on cell
 
try placing the following formula in the "formula" section of the data
validation dialog box.

=AND(LEN(A1)=8,NOT(ISNUMBER(VALUE(RIGHT(A1,1)))))

dalymjl

Quote:

Originally Posted by dan dungan (Post 716380)
try placing the following formula in the "formula" section of the data
validation dialog box.

=AND(LEN(A1)=8,NOT(ISNUMBER(VALUE(RIGHT(A1,1)))))

Many thanks for you help. There is still a slight problem as that validation would permit a letter or other character in the first 7 digits and I only want numbers in the first 7 places.

regards

MJD

Peo Sjoblom[_2_]

Validation on cell
 
=AND(LEN(A1)=8,ISNUMBER(--(LEFT(A1,7))),CODE(RIGHT(A1,1))=65,CODE(RIGHT(A1, 1))<=90)


the above will not allow lower case at the end, if you want that the users
to be able to enter both a and A use


=AND(LEN(A1)=8,ISNUMBER(--(LEFT(A1,7))),CODE(UPPER(RIGHT(A1,1)))=65,CODE(UP PER(RIGHT(A1,1)))<=90)

--


Regards,


Peo Sjoblom

"dalymjl" wrote in message
...

dan dungan;716380 Wrote:
try placing the following formula in the "formula" section of the data
validation dialog box.

=AND(LEN(A1)=8,NOT(ISNUMBER(VALUE(RIGHT(A1,1)))))


Many thanks for you help. There is still a slight problem as that
validation would permit a letter or other character in the first 7
digits and I only want numbers in the first 7 places.

regards

MJD




--
dalymjl




dalymjl

Quote:

Originally Posted by Peo Sjoblom[_2_] (Post 716737)
=AND(LEN(A1)=8,ISNUMBER(--(LEFT(A1,7))),CODE(RIGHT(A1,1))=65,CODE(RIGHT(A1, 1))<=90)


the above will not allow lower case at the end, if you want that the users
to be able to enter both a and A use


=AND(LEN(A1)=8,ISNUMBER(--(LEFT(A1,7))),CODE(UPPER(RIGHT(A1,1)))=65,CODE(UP PER(RIGHT(A1,1)))<=90)

--


Regards,


Peo Sjoblom

"dalymjl" wrote in message
...

dan dungan;716380 Wrote:
try placing the following formula in the "formula" section of the data
validation dialog box.

=AND(LEN(A1)=8,NOT(ISNUMBER(VALUE(RIGHT(A1,1)))))


Many thanks for you help. There is still a slight problem as that
validation would permit a letter or other character in the first 7
digits and I only want numbers in the first 7 places.

regards

MJD




--
dalymjl


Many thanks Peo.

That works brilliantly!


All times are GMT +1. The time now is 04:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com