Data Validation -- Numbers in Text Field

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
174
I can't seem to figure this out -- any help would be greatly appreciated.

I'm trying to validate a column in my excel workbook with the following criteria:

Length of 9 characters
Each character must be a number
The first character may be '0'.
The field itself should remain a text field.

So both 012345678 And 123456789 would be valid.

I have the following custom data validation formula:

=AND(ISNUMBER(B3), LEN(B3)=9)

But of course, this would eliminate '012345678', considering it 8 characters, not 9.

Any ideas? Thanks.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try this:
Code:
=AND(ISNUMBER(B3+0),LEN(B3)=9)
 
Upvote 0
Try this:
Code:
=AND(ISNUMBER(B3+0),LEN(B3)=9)
I am guessing that for the kinds of values that will be entered into cell B3, your formula should be sufficient, but the OP should know that it is not fully robust as it will report TRUE for values like these...

April2018

1.23456E8

-1.23e-04
 
Upvote 0

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

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