Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

excel, office, formula, calulate

Posted on 2013-02-06
3
Medium Priority
?
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Assisted Solution

by:redmondb
redmondb earned 500 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 49

Accepted Solution

by:
PortletPaul earned 500 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

670 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