You are here:

Excel/adding hours and dates where the date is also in the cell

Advertisement


Question
I need to add the hours for staff but the cells i am working with also have a date in them.  I'm finding it difficult to remove the date without having to format each one individually.  I have tried doing =hour(cellref)and Minute(cellref) but this does not seem to work.  Can you provide any guidance

Answer
Kokila

Usually the problem is one of formatting, but this should work for you

If your dates are as follows

cell C5     12/1/12 12:00 AM
cell D5     12/1/12 2:30 AM

And the cells are formatted as they appear

The formula =(+D5-C5)*24
which is in a cell formatted as general or number,

Will produce the result 2.5, or 2 and 1/2 hours.

Hope this works for you

Richard
Florida
USA
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Richard Roberts

Expertise

Can assist you in most areas of Excel, have been working with it for about 15 years in many types of applications, but primarily in financial and accounting applications. I am a CPA and many client or client problems have necessitated the use of excel. I am not an expert in charting, macros, or pivot tables.

Experience

Have been working with Excel for about 20 years primarily in accounting and financial areas.

Education/Credentials
BA, Certified Public Accountant

©2016 About.com. All rights reserved.