Custom Data Validation Formula not working as expected

ashleighbrown

New Member
Joined
Mar 10, 2023
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I'm trying to set up some data validation so that the cells only allow numbers input written in the format "XX/XX" where X is any numeric value, and the / separates the two. Basically it is going to be a way of showing age in years and months.

I have the following custom formula in data validation:

'=AND(ISNUMBER(LEFT(AE2,2)+0),MID(AE11,3,1)="/",ISNUMBER(RIGHT(AE2,2)+0))'

For some reason, the validation is allowing some numbers (e.g. it allows 45/07 and any starting number above 31, but won't allow 12/07) since the spreadsheet is for children of school age, the numbers I need people to be able to input are between 10-14 so not really sure why the formula likes higher numbers as opposed to the lower ones. Could anyone shed some light?

Thanks!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
nevermind I've worked it out! It wasn't the formula but the format of the cells trying to change to a date format - i've changed to a Text format and no issue now!
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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