data validation for time but user enters decimal value < 1 eg 0.6

phras81

New Member
Joined
Nov 2, 2018
Messages
11
I have a spreadsheet that I would like people to be able to only enter a time value into. If they enter time as 01:35 this is accepted. If they enter 1.5 it is refused as not in a time format. However if they enter 0.6 it will be accepted and show a time value of 14:24. Surely this decimal value should be rejected? Can anyone help please? Thank you
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
But did you consider this :
If you need to use the times in calculations, they could be converted to time values in another column with : =A1+0

Also, depending upon what calculations you are doing, an extra column might not be necessary.
For example, if a total of the text column is required : =SUMPRODUCT((A1:A3)+0)
 
Upvote 0
Thank you for all the ideas so far. Having 2 separate input boxes for the time will not work in this case I am afraid. There are other sheets outwith my control that reference the times in these cells. To change the layout would mean massive collaboration and changes. Is there not a way to just restrict the input to time value only and not accept 0.6 for example as an input?
 
Upvote 0
Only thing i can think of is to use a spare cell with validation such as footoo described earlier using text then putting a formula in your original cell:

=0+newcell

That would work i suppose. A lot of excel formulas could actually coerce a textual time into a real time.
 
Upvote 0
Try data validation with formatting the cell for time.

For cell P1, formated for time.

DATA --> Data validation
Custom
Formula is
=AND(P1>=0,P1<1)
 
Upvote 0
Try data validation with formatting the cell for time.

For cell P1, formated for time.

DATA --> Data validation
Custom
Formula is
=AND(P1>=0,P1<1)

I have tried using this custom data validation formula. On my sheet the cell I am trying to lock down to only allow time is H14 so changed the P1 to H14. I also formatted that cell as time. When I input 0.6 into the cell it is still accepted and the time of 14:24 displayed. Can you help and am I doing something wrong?
 
Upvote 0
0.6 and 14:24 are the same. If you type 0.6 into a cell it is a valid time. There is nothing you can do as far as I'm aware as stated in post 2.
 
Upvote 0
Format the cell for text.
Data validation.

Data --> Data validation
Custom --> formula
=AND(ISNUMBER(FIND(":",A3)),LEN(A3)<=5,,LEN(A3)>3)

Now entering in time format is must. Number in any format will notbe accepted.
For clculation purpose use

=Value(A3)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,997
Messages
6,175,874
Members
452,679
Latest member
darryl47nopra

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