time #11

I have set up a spreadsheet with time based on what our company truck
drivers work.  We work under a DOT rule of 70 hours / 8 days.  That
means that the driver can not work more than 70 hours in an 8 day
period.

The sheets I have (one for each month) goes back 7 days plus the
current day and calculated how many hours a day the driver works and
subtracts it from 70, leaving how many  hours they can work the next
day.  If the calculation gets to 0 or above, the cell changes color to
alert me that the driver's 70 hours are up and he/she has to have 34
hours off before he/she can be on duty again.

That part of the sheet works perfectly.

I wanted to set up another sheet (in the same workbook) to put their
time in from their time card to automatically calculate how many hours
they worked for the day.
I have it set up for Sunday  Monday  Tuesday  ........ Saturday.

Sunday    17:00
02:29                          =9:29   
(hours worked that day)

I got that working ok, except when they come on in the evening (say
5:00 pm) and work until after midnite (say 2:29 am).  I found a formula
to make this work but don't understand how it works.  Can someone
explain how it works?

cell  --  a1         17:00     (time in)
cell  --  a2         02:29     (time out)

the formula in cell b1 is     =(a2<a1)+a2-a1  (how many hours worked)


Also I need a macro (maybe?) to change the results in cell b1:
1. when it says 5:07  -- change to 5:00
2. when it says 5:12  -- change to 5:15
3. when it says 5:35  -- change to 5:30  

In other words  --  1-7minutes   on the hour       
8-22 minutes to the 15 minute mark
23-38 minutes to the half hour mark   etc.....  


Then I would like for the macro to take those results and put them into
the cells back on the month we are working on (on another sheet - same
workbook)  --- so it will calculate how many hours are left for the
driver to work.

I can insert these hours manually by looking at the timecards (because
the driver has already put how many hours he worked that day on it),
but sometimes they don't figure them correctly, but it's best for the
compter to do this as above.

Clear as mud????  I can send the workbook if need be.  It 1 mb.

Thanks for any help.....I'll keep working on the macro also....

Don


-- 
securityman
------------------------------------------------------------------------
securityman's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=8829
View this thread: http://www.excelforum.com/showthread.php?threadid=379217

0
6/15/2005 1:10:23 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
529 Views

Similar Articles

[PageSpeed] 4

Hi!

>Can someone explain how it works?
> the formula in cell b1 is     =(a2<a1)+a2-a1  (how many hours worked)

Excel evaluates dates as integer numbers. One day (24 hours) has a value of 
1.

Time is the fractional part of a day (1). A new day starts at 12:00 AM (open 
to interpretation) so you must account for that in dealing with time periods 
that span past midnight.

The formula is using a boolean test to determine if the time span goes into 
the next day.

(a2<a1) will evaluate to either TRUE or FALSE and those boolean values can 
be used in math operations. TRUE = 1 and FALSE = 0. So,

02:29 is less than 17:00 so 1 is added to the value in A2 during the 
calculation process. So,

A2<A1 = 1
1+A2 = 1.1034722222
1.1034722222 - A1
1.1034722222 - .70833333333

= (in h:mm format) 9:29

To round B1 to the nearest 15 minutes:

=ROUND(((A2<A1)+A2-A1)/(15/1440),0)*15/1440

OR:

=ROUND(((A2<A1)+A2-A1)/TIME(0,15,0),0)*TIME(0,15,0)

> Then I would like for the macro to take those results and put them 
> into.....

Can't help ya with that one!

Biff

"securityman" <securityman.1qnaua_1118801113.2047@excelforum-nospam.com> 
wrote in message 
news:securityman.1qnaua_1118801113.2047@excelforum-nospam.com...
>
> I have set up a spreadsheet with time based on what our company truck
> drivers work.  We work under a DOT rule of 70 hours / 8 days.  That
> means that the driver can not work more than 70 hours in an 8 day
> period.
>
> The sheets I have (one for each month) goes back 7 days plus the
> current day and calculated how many hours a day the driver works and
> subtracts it from 70, leaving how many  hours they can work the next
> day.  If the calculation gets to 0 or above, the cell changes color to
> alert me that the driver's 70 hours are up and he/she has to have 34
> hours off before he/she can be on duty again.
>
> That part of the sheet works perfectly.
>
> I wanted to set up another sheet (in the same workbook) to put their
> time in from their time card to automatically calculate how many hours
> they worked for the day.
> I have it set up for Sunday  Monday  Tuesday  ........ Saturday.
>
> Sunday    17:00
> 02:29                          =9:29
> (hours worked that day)
>
> I got that working ok, except when they come on in the evening (say
> 5:00 pm) and work until after midnite (say 2:29 am).  I found a formula
> to make this work but don't understand how it works.  Can someone
> explain how it works?
>
> cell  --  a1         17:00     (time in)
> cell  --  a2         02:29     (time out)
>
> the formula in cell b1 is     =(a2<a1)+a2-a1  (how many hours worked)
>
>
> Also I need a macro (maybe?) to change the results in cell b1:
> 1. when it says 5:07  -- change to 5:00
> 2. when it says 5:12  -- change to 5:15
> 3. when it says 5:35  -- change to 5:30
>
> In other words  --  1-7minutes   on the hour
> 8-22 minutes to the 15 minute mark
> 23-38 minutes to the half hour mark   etc.....
>
>
> Then I would like for the macro to take those results and put them into
> the cells back on the month we are working on (on another sheet - same
> workbook)  --- so it will calculate how many hours are left for the
> driver to work.
>
> I can insert these hours manually by looking at the timecards (because
> the driver has already put how many hours he worked that day on it),
> but sometimes they don't figure them correctly, but it's best for the
> compter to do this as above.
>
> Clear as mud????  I can send the workbook if need be.  It 1 mb.
>
> Thanks for any help.....I'll keep working on the macro also....
>
> Don
>
>
> -- 
> securityman
> ------------------------------------------------------------------------
> securityman's Profile: 
> http://www.excelforum.com/member.php?action=getinfo&userid=8829
> View this thread: http://www.excelforum.com/showthread.php?threadid=379217
> 


0
biffinpitt (3172)
6/15/2005 4:09:12 AM
Thanks, Biff

The round fuction worked perfectly.  

I figured that was the way the other (a2<a1) worked, but wanted to make
sure.

I have some ideas about the other (getting the results from the cell in
my Hours sheet over to the correct cell in one of my Months sheet), so I
will keep working on that.


Thanks for the help,

Don


-- 
securityman
------------------------------------------------------------------------
securityman's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=8829
View this thread: http://www.excelforum.com/showthread.php?threadid=379217

0
6/15/2005 10:44:12 AM
Reply:

Similar Artilces:

Formatting cells with Time data
I'm trying to set up my spreadsheet to format my cells to hhmm, but every time I try to enter data into the cells, the system automatically converts the hours I've entered into a date and leaves the time value at 0 any suggestions as to what I'm doing wrong? Are you entering as hh:mm regardless of the cell format? -- __________________________________ HTH Bob "yimkhoc" <yimkhoc@discussions.microsoft.com> wrote in message news:A481A01F-0938-4F38-A93C-F2B9CB0BD34C@microsoft.com... > I'm trying to set up my spreadsheet to format my cells to hhmm, but ev...

Time functions #2
Hi, I have to do some time calculations and I have a formula that outputs in minutes and I have to subtract a standard time to this number of minutes. For example, I have 8:00 AM in one cell and 20.68 minutes on an other cell. The output that I am expecting is 7:39 AM. Does anybody know how to bring an output like that by subtracting the minutes? Please help. Thanks With 8:00 AM in A1 and 20.68 in B1, use this formula =A1-B1/(24*60) Why does it work? Because Excel stores time as a fraction of a day. We convert minutes to days by dividing by 24*60 (24 hr/day and 60 min/hr) You could just u...

Run Time Error '1004' Application or Onject-defined
Hi all. I am having a strange problem with the below code in that it produces the run time error when trying to Paste the Selection. However, if I perform the action manually in exactly the same way, as in recording the macro in the first place, it works!? How can I get this to run - it is after all, a really simple code. (Most frustrating) Thanks, Wes. Windows("Transaction_Record.xlsm").Activate Sheets("DETAILED_PMNTS_REC").Select Range("N2077:QV2089").Select Application.CutCopyMode = False Selection.Copy Windows("AUDIT_TR...

convert Times New Roman Special G1 into arial
hello. I need to convert a text written with font Times New Roman Special G1, which I downloaded from the internet, into a font availanble in most computers, such as arial. Can you help me please? Thanks a lot. Fabian This newsgroup is for questions about Access, the database product that's part of Office Professional. I suspect you're asking about how to do this with some other product. I'd recommend reposting to a newsgroup related to whatever product it is you're trying to use. If you are talking about Access, please explain what exactly it is that you downloaded fro...

Calculating Time Difference
Hi, I am trying to develop a query where my client wants to track how much time in minutes does a nurse spend in various activities (staff education, patient/family education, answering drug relation questions etc. etc.) to assist nurses in other units. What query type should I use? How do I write the query? There is a start time (when the nurse recieves the call) and completion time (when the nurse hangs up). Thanks Mrinalini <drmrinalini@gmail.com> wrote in message news:1176645431.981118.294870@e65g2000hsc.googlegroups.com... > Hi, > > I am trying to develop a query wher...

Publisher 97 and date/time print
I am designing an office card using 1997 Publisher. No matter what I do it prints day, month,year and time on every page. I have checked background and there is no text box even there to delete to stop this problem. How can I find and delete? This will be an option of your printer driver. Disable that option and your trauma will be over. -- ...

Getting local Time and date for the local computer(vista OS)
Hi I am working with Vista(one of a kind), and have a MFC application and would like to add small code that will get current time and date from the local compuetr. i meet an example in MSDN : http://msdn.microsoft.com/en-us/library/aa390423(VS.85).aspx but it looks too long for what i am looking, is there a 1 function API that returns the Date and the time ? thanks for your time Zack >Hi I am working with Vista(one of a kind), >and have a MFC application and would like to add small code that will get >current time and date from the local compuetr. >i meet an example in MSDN...

Calculate meeting timings
Hi, I had one requirement. I want to calculate my total meetings time i spent througout the week, month or year. This will help how to manage my time between my work and meeting. Any solution to this??? ...

program loading time
The money 05 loads very slow, I have archived everthing past 90 days but it still loads slow. Any suggestions? In microsoft.public.money, oltexasboy wrote: >The money 05 loads very slow, I have archived everthing past 90 days but it >still loads slow. Any suggestions? Restore the archive as your main file, if you have not gone too far with it since the archive. Archiving did not help your speed appreciably, and you might want to refer to that older data. Consider reducing scheduled bills. Remove accounts from the budget if you think that would be appropriate. Set your start page t...

after some time sent mail turns as i symbol mail why?
sent mail turns with i symbol in sent items when i' using outlook. why it is happening so and what does it mean? It means you are tracking that email for voting or other purposes. =20 See http://www.howto-outlook.com/howto/icons.htm --=20 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After furious head scratching, Stalin asked: | sent mail turns with i symbol in sent items when i' using | outlook. why it is happening so and what does it mean? ...

entering time
Is there a way to set up a cell so that I can type in 1330, and have Excel put in the colon so it reads 13:30 (military time)? right click sheet tab>view code>insert this. As written, works on a1:a100 Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) 'Ron Rosenfeld <ronrosenfeld@nospam.org> Dim InputRange As Range Dim Temp As Variant Dim i As Integer Dim Separators(2) As String Separators(0) = ";" Separators(1) = "," Separators(2) = "." Application.EnableEvents = False Set InputRange = [A1:A100] 'or whatever If Intersec...

processor time allocation
My app routinely only gets 10 to 30 % of CPU time - the system idle process gets the rest (indicated by windows task manager) My app is multithreaded and has one thread that requires lots of CPU time at 20 Hz intervals. I sleep this thread for an amount of time that would put it at the next 20 Hz interval. My other threads sleep when they are not busy. My 20 Hz thread does not recieve the processor time that it needs - even though the system idle process is taking up 70 to 90 % of the CPU time. If I remove the sleep call from my 20 Hz thread then it hogs all of the CPU time and the s...

Outlook takes long time in new message with word 2003 as editor
Good Day Urgently need help in troubleshooting a problem which is spread among many clients in which Outlook takes long time when you create or reply first message after starting outlook , our clients are windows XP with SP3 and the Microsoft office is office 2003 with SP3 , My machine suffers from this error although i have patched it to the latest updates from Microsoft update , I have Mcafee Viruscan Enterprise 8.5.0i and i have disabled access protection when outlook startes but it did not solve the problem Apprecite quick advice and any troubleshooting tips Ahmedg You mentioned e...

How to make Bullen's FilterCriteria() data refresh real-time?
Using XL 2003 & 2000 OK, with help, I was able to utilize Steve Bullen's FilterCriteria() Function. That said, apparently the only way to refresh the data in the display cell is to re-activate the formula by pressing <ENTER> in the Fx Box. Can the display cells be made to refresh in real-time or, second best, by F9? FYI (Background Info): ************************************************************II placed this formula into cell A1: =FilterCriteria(A3) Cell A3 contains the Autofilter down-arrow for column A ************************************************************* Fu...

Upgrade 6.0->7.5->8.0 with PA
I am conducting a test upgrade from 6.0 to 8.0 through 7.5 with Project Accounting on a test server. The PA conversion to 7.5 took about 11 hours which is manageable but the conversion to 8.0 has already taken 3 days! and is still running. It has spent most of the time on one particular task and I wondered if anyone else has experienced this and if there is any way to improve the situation. All I can see from SQL Profiler is that the auto-procedure zDP_RM00401SS_1 is being called for each row of that table in turn sometimes many times for the same row. There are about 28000 rows and I&...

Outlook meeting request time off
User A sends User B a meeting request for Thursday at 2:00pm til 4:00pm. User B accepts. The problem is that the meeting shows up on user B's calendar at 1-3. One hour behind. It shows up on User A's calendar at the correct time from 2-4. I checked all the time settings in the OS and Outlook on both computers and they are correct. The only difference is that User A has Windows NT and User B has Windows XP. I try the same test from another user's computer who has NT. Same problem. When the XP user sends a meeting request to the other XP user the time shows up in both of the...

Real time data in visio ?????
I have developed a screen in Visio choosing the Process Engineering category and placed a label on the screen to display the data continously . The data is picked up from the file say c:\test.txt.This file (c:\test.txt)is updated with random data from a simulator program running on the same machine. This program works fine when i run from Visio. The value gets updated on the screen every second. But when i use Visio viewer to deploy my application the application opens automatically in IE 5.0. I am able to view all the screens and navigate also. But my label control does not show any change of...

Network Password entered each time Outlook starts
I have Office XP Pro with Outlook 2002 and EVERY time I start up Outlook it asks me to enter my Network Password. I do and check the box to remember my password but is shows up again next time. Anyone know how to get it to accept the password? I had Office 97 and Outlook 97 before and never had this problem. I have already installed Office XP Service Packs 1 & 2. brunyon@knoxy.net If you are still having problems after applying both the SP 1 & 2 patches, then see if this article addresses your problem OL2002: The Save Password Setting Is Not Saved When You Connect to a POP...

test #11
please use the test groups "h" <h@ms.com> wrote in message news:Oq5QWRPRFHA.2384@tk2msftngp13.phx.gbl... > > ...

Calculate the total overlapping time of multiple tasks, excluding non-working times
I am developing a tracking calculator for an overall process. Within the overall process, there are 3 steps which are completed. These steps can be completed independently from one another, but can also (sometimes) overlap. I am trying to determine the total time for the overall process (from beginning to end), without counting the duplicated times where the steps are running parallel to one another, or times when some steps may be completed and are waiting for another to start. I have outlined the basic design of the worksheet below, with times in mm/dd/yyyy hh:mm format. S...

Timing-Out Error Message for 1 MB Attachment
I'm getting a Timing-Out Error Message when I send an attachment that's about 1.0 MB. It started after some (Microsoft, I think) updates and it seems like it should be easy to change some criteria in Outlook, but haven't found it yet. I can still send the attachment thru BellSouth/DSL mailbox, so why won't Outlook handle it? Any help would be appreciated. ...

Time Zone Adjustment
Maybe someone can help me with the following question: I use Vista and Outlook 2003. How can I change the Time Zone without the stored appointments being changed, e.g. my laptop is set for European time (GMT +1), but now I'll be in South Africa (GMT +2) for the next couple of months. If I change the Time Zone all appointments get moved by 1 hour, which I obviously don't want since an appointment set for 0830 is still 0830 and not 0930. Any thoughts? Thanks help. Richard You'll either need to leave the computer in the old TZ or change it and set outlook to use 2 TZ. You...

EWS and constant reminders
If a person created a reoccurring event using Entourage 2008 when Standard time was in effect for an event that begins during Daylight time (for example a reoccurring event beginning in May was created back in Jan) than when the event reminder is generated later it pops up every minute for the event despite being dismissed each time. When viewing the event using Outlook 2007 - Standard time is listed in the description. To fix the issue the reoccurring event has to be recreated during the same time adjustment period. I've had to do this for annual events (birthdays) that were c...

HELP: Add textbox to a frame at run time
Hi All, How can I add text boxes on the form at run time based on what user inputs in a textbox? For eg: I have a textbox "Total Students" , so Once I input a number in that textbox, I want to have that many textboxes on the form during run time. If I input 4 I want four textboxes to be displayed on the form. Thanks in advance ...

Problems installing WMP 11 On XP Professional Machine
WMP install fails with a '0x8007f00d' error. I have tried renaming spupdsvc.exe, but that did not solve the problem. It is an XP Professional Machine with SP2, and if I could fix the problem without updating to SP3 that would be ideal. Following are the wmp11.log and updspapi.log files. [wmp11.log] 0.120: 2010/06/24 10:55:25.787 (local) 0.120: c:\3d75f72a135b08c2fda0e9328ba9\update\update.exe (version 6.2.29.0) 0.130: Hotfix started with following command line: /quiet /norestart /er 0.701: In Function TestVolatileFlag, line 11873, RegOpenKeyEx failed with error 0x2 0.7...