Solved

excel, office, formula, calulate

Posted on 2013-02-06
3
297 Views
Last Modified: 2013-02-08
I have an Excel Document that has the following columns:
 A11 = Date In  (Date Format)      
 B11 = Time In      (Time Format)
 C11 = Date Out       (Date Format)
 D11 = Time Out (Time Format)

We need to calculate the amount of hours and minutes between the two date and time period.
How can this be done?

Screenshot of the spreadsheet setup attached.
0
Comment
Question by:bax2000
3 Comments
 
LVL 26

Assisted Solution

by:redmondb
redmondb earned 125 total points
ID: 38859027
Hi, bax2000.

The formula is...
=A13+A14-A11-A12
..and you need to format the cell as follows...
[h]:mm
...(the square brackets tell Excel to display Hour values greater than 24.)

Regards,
Brian.
0
 
LVL 48

Accepted Solution

by:
PortletPaul earned 125 total points
ID: 38859028
this will work; but it has no exception handling

=(C11-A11)+(D11-B11)

e.g.
date in      time in      date out     time out   hours
1/02/2013      9:16      1/02/2013      17:23      8:07

Open in new window

if you think that isn't sufficient try:
=DATE(YEAR(A11),MONTH(A11),DAY(C11))-DATE(YEAR(C11),MONTH(C11),DAY(C11))+(TIME(HOUR(D11),MINUTE(D11),SECOND(D11))-TIME(HOUR(B11),MINUTE(B11),SECOND(B11)))

Open in new window


If the number of days isn't multiplied by 24, but (for example) a "day" is 8 hours, then:


=((C11-A11)*8)+(D11-B11)

or the more comprehensive alternative:

=(DATE(YEAR(A11),MONTH(A11),DAY(C11))-DATE(YEAR(C11),MONTH(C11),DAY(C11))*8)+(TIME(HOUR(D11),MINUTE(D11),SECOND(D11))-TIME(HOUR(B11),MINUTE(B11),SECOND(B11)))

Open in new window

and the "8" (hours per day) could be a cell reference of course.

if there are any standard deductions (e.g. for lunch) then that could be added into the formula also.
0
 

Author Closing Comment

by:bax2000
ID: 38859154
All Working as needed.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question