Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dr. Darrell
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower "30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Hi

One way
=IF(MINUTE(A1)<30,FLOOR(A1,TIME(0,30,0)),CEILING(A 1,TIME(1,0,0)))

--
Regards

Roger Govier


"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to
the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower
"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alan
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Try
=ROUND(C1*24,0)
and format the cell as a number with two decimal places
This will display 13.00 as opposed to 13:00, is that a problem? If so post
back,
Regards,
Alan.
"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower "30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower "30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
a7n9
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Although, this is not elegant it should get you started, suppose D5 has your
time.
=IF(MINUTE(D5)<30,TIME(HOUR(D5),0,0),IF(D530,TIME (HOUR(D5)+1,0,0),D5))

Actually, the functions CEILING and FLOOR could be used, but I can't figure
it right now.
--
-When you get to the end of your rope, tie a knot and hang on
<a href="www.nandeshwar.info/projects/xlblog"My Excel/VBA Page</a


"Dr. Darrell" wrote:

I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower "30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

I think Bob meant ROUNDUP

"Bob Phillips" wrote in message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to
the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower "30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

No, I meant ROUNDDOWN. The OP said ... I would also like some of the values
to round back to the next lower "30
.....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to
the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower

"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell







  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Okay, now that I read the second half, I see that when to roundup/rounddown
was not specified.
My apologies, Bob

"Bob Phillips" wrote in message
...
No, I meant ROUNDDOWN. The OP said ... I would also like some of the
values
to round back to the next lower "30
....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to
the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower

"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell








  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Aah! but it was.
The OP said round to the next higher half hour when 12:45, and round
back to 12:00 when it was 12:15
Maybe
=IF(MINUTE(A1)<30,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)


--
Regards

Roger Govier


"Bob Tarburton" wrote in message
...
Okay, now that I read the second half, I see that when to
roundup/rounddown was not specified.
My apologies, Bob

"Bob Phillips" wrote in message
...
No, I meant ROUNDDOWN. The OP said ... I would also like some of the
values
to round back to the next lower "30
....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in
message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in
message
...
I have a worksheet that I enter time values into individual
cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to
round to
the
next higher "30 minute increment" such as Cell C1 should become
13:00.

I would also like some of the values to round back to the next
lower

"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell










  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Geez that is confusing!

Bob


"Roger Govier" wrote in message
...
Aah! but it was.
The OP said round to the next higher half hour when 12:45, and round
back to 12:00 when it was 12:15
Maybe
=IF(MINUTE(A1)<30,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)


--
Regards

Roger Govier


"Bob Tarburton" wrote in message
...
Okay, now that I read the second half, I see that when to
roundup/rounddown was not specified.
My apologies, Bob

"Bob Phillips" wrote in message
...
No, I meant ROUNDDOWN. The OP said ... I would also like some of the
values
to round back to the next lower "30
....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in
message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in
message
...
I have a worksheet that I enter time values into individual
cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to
round to
the
next higher "30 minute increment" such as Cell C1 should become
13:00.

I would also like some of the values to round back to the next
lower
"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell














  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

C'est la vie!!!

--
Regards

Roger Govier


"Bob Phillips" wrote in message
...
Geez that is confusing!

Bob


"Roger Govier" wrote in message
...
Aah! but it was.
The OP said round to the next higher half hour when 12:45, and round
back to 12:00 when it was 12:15
Maybe
=IF(MINUTE(A1)<30,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)


--
Regards

Roger Govier


"Bob Tarburton" wrote in
message
...
Okay, now that I read the second half, I see that when to
roundup/rounddown was not specified.
My apologies, Bob

"Bob Phillips" wrote in message
...
No, I meant ROUNDDOWN. The OP said ... I would also like some of
the
values
to round back to the next lower "30
....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in
message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in
message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in
message
...
I have a worksheet that I enter time values into individual
cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to
round to
the
next higher "30 minute increment" such as Cell C1 should
become
13:00.

I would also like some of the values to round back to the next
lower
"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for
this.

Darrell














  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

I should get off this one, but...
note that the latest function always goes to the nearest top of the hour
unless A1 is exactly the bottom of the hour, or
=IF(MINUTE(A1)=30,A1,ROUND(A1*24,0)/24)

Maybe
=IF(AND(MINUTE(A1)<=15,MINUTE(A1)=45),ROUNDDOWN(A 1*48,0)/48,ROUNDUP(A1*48,0)/48)
??

"Roger Govier" wrote in message
...
Aah! but it was.
The OP said round to the next higher half hour when 12:45, and round back
to 12:00 when it was 12:15
Maybe
=IF(MINUTE(A1)<30,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)


--
Regards

Roger Govier


"Bob Tarburton" wrote in message
...
Okay, now that I read the second half, I see that when to
roundup/rounddown was not specified.
My apologies, Bob

"Bob Phillips" wrote in message
...
No, I meant ROUNDDOWN. The OP said ... I would also like some of the
values
to round back to the next lower "30
....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in message
...
I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round
to
the
next higher "30 minute increment" such as Cell C1 should become
13:00.

I would also like some of the values to round back to the next lower
"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell












  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Hi Bob

No, I don't think that is what the OP wanted.
His request
Data 6:00 12:00 12:45 17:15
Result 6:00 12:00 13:00 17:00
He didn't supply times for 6:30 and 12:30 but he did say the rounding
should be to the 30 minutes, other than 0:15 goes down and 0:45 goes up.

My first posting
=IF(MINUTE(A1)<30,FLOOR(A1,TIME(0,30,0)),CEILING(A 1,TIME(1,0,0)))
Result 6:00 12:00 13:00 17:00 7:00 13:00
both these last 2 (which I didn't test), would have been wrong.

Bob's =ROUNDDOWN(A1*48,0)/48
Result 6:00 12:00 12:30 17:00 6:30 12:30
the first 12:30 is wrong

My amendment of Bob
=IF(MINUTE(A1)<30,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)
Result 6:00 12:00 13:00 17:00 6:30 12:30
all as requested

Your latest proposal =IF(AND(MINUTE(A1)<=15,MINUTE(A1)=45)
,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)
Result 6:00 12:00 13:00 17:30 6:30 12:30
the 17:30 time is wrong

I think on balance, Bob's formula, with my amendment just shades it<bg

--
Regards

Roger Govier


"Bob Tarburton" wrote in message
...
I should get off this one, but...
note that the latest function always goes to the nearest top of the
hour unless A1 is exactly the bottom of the hour, or
=IF(MINUTE(A1)=30,A1,ROUND(A1*24,0)/24)

Maybe
=IF(AND(MINUTE(A1)<=15,MINUTE(A1)=45),ROUNDDOWN(A 1*48,0)/48,ROUNDUP(A1*48,0)/48)
??

"Roger Govier" wrote in message
...
Aah! but it was.
The OP said round to the next higher half hour when 12:45, and round
back to 12:00 when it was 12:15
Maybe
=IF(MINUTE(A1)<30,ROUNDDOWN(A1*48,0)/48,ROUNDUP(A1*48,0)/48)


--
Regards

Roger Govier


"Bob Tarburton" wrote in
message ...
Okay, now that I read the second half, I see that when to
roundup/rounddown was not specified.
My apologies, Bob

"Bob Phillips" wrote in message
...
No, I meant ROUNDDOWN. The OP said ... I would also like some of
the values
to round back to the next lower "30
....

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bob Tarburton" wrote in
message
...
I think Bob meant ROUNDUP

"Bob Phillips" wrote in
message
...
=ROUNDDOWN(A1*48,0)/48


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dr. Darrell" wrote in
message
...
I have a worksheet that I enter time values into individual
cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to
round to
the
next higher "30 minute increment" such as Cell C1 should become
13:00.

I would also like some of the values to round back to the next
lower
"30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for
this.

Darrell














Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time entry leah Excel Discussion (Misc queries) 9 January 18th 05 01:47 PM
Time Format Auto Entry AM and PM BulaMan Excel Discussion (Misc queries) 1 December 15th 04 09:30 AM
Time Entry mike47338 Excel Worksheet Functions 3 November 18th 04 09:02 PM
Round Time cpme Excel Worksheet Functions 2 November 18th 04 07:09 PM
How do I round time? cpme Excel Worksheet Functions 3 November 17th 04 12:37 AM


All times are GMT +1. The time now is 01:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"