Solved

excel, office, formula, calulate

Posted on 2013-02-06
3
272 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now