Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Rounding to nearest quarter hour?

If we have a column of times we're adding up in a formula like, say,
=sum(C4:C20) and we're dealing with times is there a way to modify
that formula so that it rounds the total to the nearest quarter hour?

p.s., since the spreadsheet had to take into account "negative" hours
in terms of subtracting hours, the spreadsheet is set to the 1904
system. Don't know if that makes any difference to the above.

Tx.

  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default Rounding to nearest quarter hour?

Hi,

Try this:

=TIME(HOUR(SUM(C4:C20)),ROUND(MINUTE(SUM(C4:C20))/15,0)*15,0)

or this:

=ROUND(SUM(C4:C20)/0.0104166666666667,0)*0.0104166666666667

or this (you'll need the Analysis Toolpack installed for this one):

=MROUND(SUM(C4:C20),0.0104166666666667)

Regards,
KL


"StargateFan" wrote in message
...
If we have a column of times we're adding up in a formula like, say,
=sum(C4:C20) and we're dealing with times is there a way to modify
that formula so that it rounds the total to the nearest quarter hour?

p.s., since the spreadsheet had to take into account "negative" hours
in terms of subtracting hours, the spreadsheet is set to the 1904
system. Don't know if that makes any difference to the above.

Tx.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Rounding to nearest quarter hour?

See http://www.xldynamic.com/source/xld.Rounding.html#time

--
HTH

Bob Phillips

"StargateFan" wrote in message
...
If we have a column of times we're adding up in a formula like, say,
=sum(C4:C20) and we're dealing with times is there a way to modify
that formula so that it rounds the total to the nearest quarter hour?

p.s., since the spreadsheet had to take into account "negative" hours
in terms of subtracting hours, the spreadsheet is set to the 1904
system. Don't know if that makes any difference to the above.

Tx.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Rounding to nearest quarter hour?

one way:

Since XL stores times as fractional days and quarter hours are 1/96 of a
day:

=ROUND(SUM(C4:C20)*96,0)/96

The date system makes no difference unless the SUM is negative.

In article ,
StargateFan wrote:

If we have a column of times we're adding up in a formula like, say,
=sum(C4:C20) and we're dealing with times is there a way to modify
that formula so that it rounds the total to the nearest quarter hour?

p.s., since the spreadsheet had to take into account "negative" hours
in terms of subtracting hours, the spreadsheet is set to the 1904
system. Don't know if that makes any difference to the above.

Tx.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Rounding to nearest quarter hour?

The first formula below seemed to work perfectly in the test runs, thanks!
I'll add it to my main overtime spreadsheet and give it a whirl.

It's easier now just to put the actual times and then let Excel round only
the last total figure rather than the reverse as we've been doing up till
now. By putting in the actual real minutes rather than rounding each day
and _then_ rounding in last figure, I believe that reflects the truer
overtime worked. Very kewl! :oD

**********************
"KL" wrote in message
...
Hi,

Try this:

=TIME(HOUR(SUM(C4:C20)),ROUND(MINUTE(SUM(C4:C20))/15,0)*15,0)

or this:

=ROUND(SUM(C4:C20)/0.0104166666666667,0)*0.0104166666666667

or this (you'll need the Analysis Toolpack installed for this one):

=MROUND(SUM(C4:C20),0.0104166666666667)

Regards,
KL


"StargateFan" wrote in message
...
If we have a column of times we're adding up in a formula like, say,
=sum(C4:C20) and we're dealing with times is there a way to modify
that formula so that it rounds the total to the nearest quarter hour?

p.s., since the spreadsheet had to take into account "negative" hours
in terms of subtracting hours, the spreadsheet is set to the 1904
system. Don't know if that makes any difference to the above.

Tx.







  #6   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default Rounding to nearest quarter hour?

Hi,

My personal prefernce is actiually with one that I didn't suggest:

=ROUND(SUM(C4:C20)*96,0)/96

Regards,
KL


"StargateFanFromWork" wrote in message
...
The first formula below seemed to work perfectly in the test runs, thanks!
I'll add it to my main overtime spreadsheet and give it a whirl.

It's easier now just to put the actual times and then let Excel round only
the last total figure rather than the reverse as we've been doing up till
now. By putting in the actual real minutes rather than rounding each day
and _then_ rounding in last figure, I believe that reflects the truer
overtime worked. Very kewl! :oD

**********************
"KL" wrote in message
...
Hi,

Try this:

=TIME(HOUR(SUM(C4:C20)),ROUND(MINUTE(SUM(C4:C20))/15,0)*15,0)

or this:

=ROUND(SUM(C4:C20)/0.0104166666666667,0)*0.0104166666666667

or this (you'll need the Analysis Toolpack installed for this one):

=MROUND(SUM(C4:C20),0.0104166666666667)

Regards,
KL


"StargateFan" wrote in message
...
If we have a column of times we're adding up in a formula like, say,
=sum(C4:C20) and we're dealing with times is there a way to modify
that formula so that it rounds the total to the nearest quarter hour?

p.s., since the spreadsheet had to take into account "negative" hours
in terms of subtracting hours, the spreadsheet is set to the 1904
system. Don't know if that makes any difference to the above.

Tx.







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
Rounding to the nearest quarter hour no longer working dramajuana Excel Discussion (Misc queries) 4 September 11th 07 12:26 AM
Rounding to the nearest quarter pdberger Excel Worksheet Functions 2 August 31st 07 01:46 AM
Rounding up to nearest quarter, (:25, :50, :75, :00) RosaR Excel Discussion (Misc queries) 6 May 30th 07 09:49 PM
How do I round time to the nearest quarter of an hour Meghan New Users to Excel 6 July 7th 06 06:36 PM
Need to round the time to the nearest quarter hour. Help John Excel Discussion (Misc queries) 1 February 11th 06 06:41 AM


All times are GMT +1. The time now is 11: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"