Validation - 10 digit number starting with 6211...

Chunky_22

Board Regular
Joined
May 19, 2004
Messages
149
I should know how to do this...

I need to use data validation to restrict entries into a cell to a 10 digit number starting with 6211. eg 6211000000

Please end my frustration and remind me how to do it!

Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I should know how to do this...

I need to use data validation to restrict entries into a cell to a 10 digit number starting with 6211. eg 6211000000

Please end my frustration and remind me how to do it!

Thanks
Try this...

Data Validation
Allow>Custom
Formula:

=AND(LEN(A1=10),--LEFT(A1,4)=6211,ISNUMBER(-MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))

If you try that formula on the worksheet it must be array entered**.

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
 
Upvote 0
Try this...

Data Validation
Allow>Custom
Formula:

=AND(LEN(A1=10),--LEFT(A1,4)=6211,ISNUMBER(-MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))

If you try that formula on the worksheet it must be array entered**.

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
Ooops! Typo

The correct formula should be:

=AND(LEN(A1)=10,--LEFT(A1,4)=6211,ISNUMBER(-MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))
 
Upvote 0
How about:

Allow whole number

Between

Minimum:6211000000
Maximum:6211999999
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top