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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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