ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Data Validation (https://www.excelbanter.com/excel-worksheet-functions/125359-data-validation.html)

BruceY

Data Validation
 
HI,
I would like to limit input to all cells within a column to the following;
cannot be more then 9 digits with the first two always being "NJ" and the
last 7 numeric including 0.

Anything other then this should generate an error message.

Any help would be gratly appreciated.
--
Bruce

Ron Coderre

Data Validation
 
Try this:

Select Col_A, with A1 as the active cell

<data<validation
Allow: Custom
Formula: =AND(COUNTIF(A1,"NJ???????"),INT(--RIGHT(A1,7))=--RIGHT(A1,7))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"BruceY" wrote:

HI,
I would like to limit input to all cells within a column to the following;
cannot be more then 9 digits with the first two always being "NJ" and the
last 7 numeric including 0.

Anything other then this should generate an error message.

Any help would be gratly appreciated.
--
Bruce


JE McGimpsey

Data Validation
 
One way:

Allow: Custom
Formula: =AND(LEFT(A1,2)="NJ",LEN(A1)<=11,ISNUMBER(--MID(A1,3,9)))

In article ,
BruceY wrote:

HI,
I would like to limit input to all cells within a column to the following;
cannot be more then 9 digits with the first two always being "NJ" and the
last 7 numeric including 0.

Anything other then this should generate an error message.

Any help would be gratly appreciated.


BruceY

Data Validation
 

--
Bruce


"Ron Coderre" wrote:

Try this:

Select Col_A, with A1 as the active cell

<data<validation
Allow: Custom
Formula: =AND(COUNTIF(A1,"NJ???????"),INT(--RIGHT(A1,7))=--RIGHT(A1,7))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"BruceY" wrote:

HI,
I would like to limit input to all cells within a column to the following;
cannot be more then 9 digits with the first two always being "NJ" and the
last 7 numeric including 0.

Anything other then this should generate an error message.

Any help would be gratly appreciated.
--
Bruce


BruceY

Data Validation
 
Hi Ron,

This worked GREAT. Thanks so much for your help and for your quick response.
--
Bruce


"Ron Coderre" wrote:

Try this:

Select Col_A, with A1 as the active cell

<data<validation
Allow: Custom
Formula: =AND(COUNTIF(A1,"NJ???????"),INT(--RIGHT(A1,7))=--RIGHT(A1,7))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"BruceY" wrote:

HI,
I would like to limit input to all cells within a column to the following;
cannot be more then 9 digits with the first two always being "NJ" and the
last 7 numeric including 0.

Anything other then this should generate an error message.

Any help would be gratly appreciated.
--
Bruce


Ron Coderre

Data Validation
 
You're very welcome, Bruce....(and thanks for the feedback!)

***********
Regards,
Ron

XL2002, WinXP


"BruceY" wrote:

Hi Ron,

This worked GREAT. Thanks so much for your help and for your quick response.
--
Bruce


"Ron Coderre" wrote:

Try this:

Select Col_A, with A1 as the active cell

<data<validation
Allow: Custom
Formula: =AND(COUNTIF(A1,"NJ???????"),INT(--RIGHT(A1,7))=--RIGHT(A1,7))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"BruceY" wrote:

HI,
I would like to limit input to all cells within a column to the following;
cannot be more then 9 digits with the first two always being "NJ" and the
last 7 numeric including 0.

Anything other then this should generate an error message.

Any help would be gratly appreciated.
--
Bruce



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

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