# Data Validation - 15 Minute Intervals - Time Range

#### khammonds294

##### New Member
I have a column of cells in which I need users to input their time spent on a project ( time input as [hh]:mm ) the hours are accumulated over a 6 month period so can exceed 24 hours - but I would like the times entered to be restricted to 15 minute intervals (eg. 60:00, 55:15, 43:30, 38:45 etc.)

I've set tried using the formula =MOD(MINUTE(G3),15) where column G3 is formatted [hh]:mm and wonder if the brackets around the HH are preventing the MOD formula to work - but I cannot think of a work around.

Can anyone help?

Thanks!

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

#### tyija1995

##### Well-known Member
Hey,

Perhaps a bit wacky but try:

=MOD(G3,(15/24/60))<0.000000001

Sometimes the result is very close to 0 when you put in a number rounded to 15mins, e.g. 01:30 gives 3.47E-18 result... There might be a cleaner way around this though

#### tyija1995

##### Well-known Member
Testing it on my end it goes a bit weird, try this instead:

=ABS(INT(G3/(15/24/60))-(G3/(15/24/60)))<0.01

Hope it works for you, let me know!

Last edited:

#### Peter_SSs

##### MrExcel MVP, Moderator
I've set tried using the formula =MOD(MINUTE(G3),15) where column G3 is formatted [hh]:mm
In any case, wouldn't you need
=MOD(MINUTE(G3),15)=0

#### tyija1995

##### Well-known Member

In any case, wouldn't you need
=MOD(MINUTE(G3),15)=0

I feel like a bit of a fool playing around with ABS and INT now! I guess I had a bit of a donut moment going around a different route when unnecessary, thanks Peter, learn something new everyday!

#### Peter_SSs

##### MrExcel MVP, Moderator
I feel like a bit of a fool playing around with ABS and INT now! I guess I had a bit of a donut moment going around a different route when unnecessary, thanks Peter, learn something new everyday!
Well, your idea of using < a small number may be a good one. I guess it is possible for the MOD function to not return exactly zero when it should, though my testing didn't turn up any. The Data Validation should work just as well and possibly be safer to use something like

=MOD(MINUTE(G3),15)<0.0000001

Last edited:

#### tyija1995

##### Well-known Member
Well, your idea of using < a small number may be a good one. I guess it is possible for the MOD function to not return exactly zero when it should, though my testing didn't turn up any. The Data Validation should work just as well and possibly be safer to use something like

=MOD(MINUTE(G3),15)<0.0000001

Agreed - the first formula I wrote was bugging me because every now and then it would return incorrectly, I think 55:00 returned 0.010417 (coincidentally that is 15/24/60) so bizarre! Clearly it should have been 0.

But then 54:00 would return 1.25E-16 and 01:00 returns 0, I suppose this is what made me divert in to another path!

#### khammonds294

##### New Member
Agreed - the first formula I wrote was bugging me because every now and then it would return incorrectly, I think 55:00 returned 0.010417 (coincidentally that is 15/24/60) so bizarre! Clearly it should have been 0.

But then 54:00 would return 1.25E-16 and 01:00 returns 0, I suppose this is what made me divert in to another path!

Thank you so much!!!! Super helpful!

Replies
7
Views
117
Replies
8
Views
2K
Replies
14
Views
165
Replies
0
Views
370
Replies
3
Views
416

1,127,765
Messages
5,626,742
Members
416,201
Latest member
brianhf

### 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.

### Which adblocker are you using?

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

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