Custom Data Validation

Woodsie

New Member
Joined
Jan 5, 2011
Messages
7
Hello all,
I am trying (and failing) to implement a custom data validation to prevent issues during data entry.

I need to permit the following example formats:

4.1
4.2.1
4.3.1.1

I can get the '4.1' level working easily enough (as it's seen as a number with decimal), however once I start getting into the sub-section numbering I am getting data entry errors. This also needs to work for different numbers at the start (e.g. 4, 5, 6 etc).
I tried this but got the error described above:

=COUNTIF(A1,"4.*")+COUNTIF(A1,"5.*")+COUNTIF(A1,"6.*")

I can also get it to work by setting the cells as 'Text' however I then of course get the green error flag for number being stored as text.

I appreciate any help you can offer, many thanks.
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Why are you using COUNTIF on a single cell?

OR(LEFT(A1,2)="4.",LEFT(A1,2)="5.",LEFT(A1,2)="6.")
 
Upvote 0
Why are you using COUNTIF on a single cell?

OR(LEFT(A1,2)="4.",LEFT(A1,2)="5.",LEFT(A1,2)="6.")

I saw the COUNTIF method on an ablebits guide, it does seem to work for the '4.1' level to be fair
I can't get your method to work, I get validation errors at all levels. I feel like I'm closer though - I can at least see the logic in your formula.
Did this work your end?

Thanks for the help.
 
Upvote 0

Forum statistics

Threads
1,224,901
Messages
6,181,639
Members
453,059
Latest member
jkevin

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