Data validation - state characters allowed

tlc53

Active Member
Joined
Jul 26, 2018
Messages
399
Hi there,

Due to other formula's relating to the cell containing this data validation, I need to amend it slightly.

It currently looks like this;

=OR(AND(ISNUMBER(B13),LEN(B13)=3),AND(ISNUMBER(LEFT(B13,3)+0),ISNUMBER(RIGHT(B13,3)+0),ISNUMBER(SEARCH("/",B13)),LEN(B13)=7))

I would like to amend the first part, so that the first 3 characters can only be "0123456789". Basically, I'd like it to treat the first 3 characters as text but only allow numbers to be entered, no letters. I came up with this but it is not working as I would like.

=OR(AND(ISTEXT(B13),"012345689",LEN(B13)=3),AND(ISNUMBER(LEFT(B13,3)+0),ISNUMBER(RIGHT(B13,3)+0),ISNUMBER(SEARCH("/",B13)),LEN(B13)=7))

Can someone help me with this please? Thank you
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try
=OR(AND(ISTEXT(B13),ISNUMBER(VALUE(B13)),LEN(B13)=3),AND(ISNUMBER(LEFT(B13,3)+0),ISNUMBER(RIGHT(B13,3)+0),ISNUMBER(SEARCH("/",B13)),LEN(B13)=7))
 
Upvote 0
Solution
One way to test if the first 3 characters are numbers

=ISNUMBER(VALUE(LEFT(B13,3)))
 
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,257
Members
448,880
Latest member
aveternik

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