[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calculate time difference between stored time and Now() in a cell with Excel 2010

Posted on 2012-08-29
8
Medium Priority
?
1,370 Views
Last Modified: 2012-08-29
I need help in creating an Excel formula to display “True” if the Now() time is greater than the stored Date/Timestamp by 8 hours.

----[C] Start Time            | [D] Over 8 hrs
[C2] – 8/28/12 16:21      | [D2]   “True”

If the time is Less Than 8 hours show  “” in column D, else show "True"
I’ve tried a few formulas but I not too familiar how to use the IF statement
0
Comment
Question by:edrz01
  • 5
  • 3
8 Comments
 
LVL 34

Accepted Solution

by:
Rob Henson earned 2000 total points
ID: 38345721
In D2:

=IF(C2<NOW()-(8/24),"True","")

Thanks
Rob H
0
 
LVL 34

Expert Comment

by:Rob Henson
ID: 38345780
To explain:

IF ( Condition, True Result, False Result)

Condition: C2 < NOW() - (8/24) -- NOW() as you've worked out gives current date and time. Excel stores dates and times as a numerical serial number. The date is the integer part of the number, 01/01/1900 being 1 and 29 Aug 2012 being 41150. The time is then the decimal part of the number, hence 8 hours being 8/24.

Logic - "Start Date & Time is less than (or prior to) NOW() - 8/24" i.e. difference between date/time and now is greater than 8 hours.

True Result - "True"
False Result - "" representing blank.

If you wanted True or False, rather than True or blank, you wouldn't have to use the IF statement. You could just use:

=C2<NOW()-(8/24)

Thanks
Rob H
0
 

Author Comment

by:edrz01
ID: 38345783
Rob, your formula does work... one step I didn't think about until I pasted your fix. In that, there are cells in C that have no Timestamp... which if there is no timestamp, then column D should render "" for a no timestamp. What do you recommend?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:edrz01
ID: 38345799
Excellent explanation for your formula.
0
 

Author Comment

by:edrz01
ID: 38345825
My objective here is to use "True" to represent the status of equipment that were tagged as non-functional at a specific date/time over 8 hours. If the equipment is functional, there will be no date/time stamp...thereby leaving that field blank and leaving the True/False statement blank.

I will be using the True stamp to then display on a dashboard those non-functional items that need repair. The True statement will provide another filtered list to show equipment with True status along with the equipment number and the date/stamp along with it.
0
 

Author Comment

by:edrz01
ID: 38345912
I'm hoping this is the corrected formula to render "" in column D IF column C is blank:
=IF(C2="","",IF(C2<NOW()-(8/24),"True",""))
0
 

Author Closing Comment

by:edrz01
ID: 38346280
Thank you very much for your assistance. Would you look at my last comment to confirm the last modification to your solution. Thx again!
0
 
LVL 34

Expert Comment

by:Rob Henson
ID: 38346693
Mod for blank in c2 is fine.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
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.

834 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