Hi Michael,
There are several workarounds for this. The easiest way for this to happen is if you use data validation with 'Time' as the 'Allow' method. Then just set your time to between 0:00 and 23:59.
Another way is to have an intermediary cell calculate the value of the input for you. Let's assume you have three cells here:
- Time Input
- Time Format
- Time Calculation
Your 'Time Input' cell can be the same cell you're using, where users are entering "4:00" or "4". The 'Time Format' cell can have an intermediary calculation in it looking at the 'Time Input' and adjusting for user error. This assumes the user will not be
entering in time values greater than 24 hours, or one day. Here is an example of the formula you could use for your 'Time Format' cell:
=IF(TimeInput>1,TimeInput/24,TimeInput)
Another way you could write it is:
=TimeInput/IF(TimeInput>1,24,1)
Both give the same result.
Then, the 'Time Calculation' is your downstream calculation, where instead of pointing it to the original 'Time Input' cell, you'd point it to the 'Time Format' intermediary calculated cell.
And another way altogether is to use a UserForm with VBA. This is a bit more in-depth, but gives you much more manual control of user inputs and what to do with them.
In any case, I'd recommend the first (data validation) solution.
Regards,
Zack Barresse