Data Validation - Must be greater than CELL and contain : symbol

TTUK

Board Regular
Joined
Apr 5, 2012
Messages
137
Hi all,

I'm trying to get a data validation for a user input into a cell.
I cannot use the TIME formatting of the cell as it won't work for what I am trying to achieve.

I need AH15 to have a number input greater than AH14 and must contain a : symbol.

E.g. 11:20 (If AH14 will equal 11:19)

If a user enters 11.20 it will not work.

If the value is incorrect a message box to appear saying 'You have entered the format incorrectly'


Hope someone can help me with this.

Thank you!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
=AND(MID(AH15,3)=":",LEFT(AH15,2)>=LEFT(AH14,2),RIGHT(AH15,2)>RIGHT(AH14,2))

This doesn't work for a time like 12:05, for example, where the hour is greater but the minutes are lower. I shall have a think about that though.
 
Upvote 0
=AND(MID(AH15,3)=":",OR(LEFT(AH15,2)>LEFT(AH14,2),AND(LEFT(AH14,2)=LEFT(AH15,2),RIGHT(AH15,2)>RIGHT(AH14,2))))

This formula checks that there is both a colon in the middle of the time (and that the time is in 24hr clock), and that either the hour is greater or the minutes are greater if the hour is the same.
 
Last edited:
Upvote 0
=AND(MID(AH15,3)=":",OR(LEFT(AH15,2)>LEFT(AH14,2),AND(LEFT(AH14,2)=LEFT(AH15,2),RIGHT(AH15,2)>RIGHT(AH14,2))))

This formula checks that there is both a colon in the middle of the time (and that the time is in 24hr clock), and that either the hour is greater or the minutes are greater if the hour is the same.


Hi, I believe this will do what I want it to do.
However, it says You've entered too few arguments for this function.


Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,212
Members
453,023
Latest member
alabaz

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