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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
=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,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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