Data Validation Rules

pan_kaj

Board Regular
Joined
Dec 28, 2004
Messages
80
Hi there,

Is there a way to restrict cell input to 8,12,13,14 digits only, please? No text, only numbers.

Hope to get some helpful suggestions.

Thanks,
Ashima
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Ashima,

If you want to enter your value into cell A1, then have it selected and then go to Data > Data Validation > Custom - Formula:
=OR(A1=8,A1=12,A1=13,A1=14)

Is this what you were looking for?
 
Upvote 0
You could use a custom validation formula like:

=AND(ISNUMBER(A1),OR(LEN(A1)=8,LEN(A1)=12,LEN(A1)=13,LEN(A1)=14))

where A1 is the cell you are validating. Be sure to uncheck the Ignore blank option.
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,952
Members
449,198
Latest member
MhammadishaqKhan

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