AllExperts > Excel 
Search      
Excel
Volunteer
Answers to thousands of questions
 Home · More Excel Questions · Answer Library  · Encyclopedia ·
More Excel Answers
Question Library

Ask a question about Excel
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About 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 15 years primarily in accounting and financial areas.

Education/Credentials
BA, CPA

 
   

You are here:  Experts > Computing/Technology > Microsoft Software > Excel > Time

Excel - Time


Expert: Richard Roberts - 11/4/2009

Question
Hi Richard,

Here's the expected result:

IF F1="" and H1="" then C1=do nothing
IF F1=something and H1="" then C1="Check Your Data"
IF F1="" and H1=something then C1="Check Your Data"
IF F1=something and H1=something then C1=F1-H1
IF F1 or H1 is greater than 24:00 then C1="Check your Data"

Here is my formula:

=IF(AND(F1="",H1=""),"",IF(H1="","Check Your Data",IF(OR(F1>1,H1>1),"Check Your Data",IF(F1="","Check Your Data",(H1<F1)-(F1-H1)))))

I use a 24 hour format. So my problem is for example
when F1=12:30 and H1=1:00 C1=12:30 which is wrong
C1 is supposed to =0:30

How do i do this..

Thanks.  

Answer
Polo

Very often the problem with time is the formatting.
If I copy your formula to a spreadsheet and format the cells F1 and H1 as 24 hour format, I.E. toolbar/format/cells/time select type of 13:30, and also format the cell C1 the same. Then your formula works as you want it to.

Hope this helps

Richard
Florida
USA  

Ask a Question


 
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
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.