Solved

Time calculation

Posted on 2015-01-23
3
53 Views
Last Modified: 2015-01-27
I have attached a spreadsheet with a formula which I cannot get to work.

cells in column B have a time already keyed in. E generates the time when the box in D is ticked. I then have a formula in cells in column G that say =IF(E2="","",IF(E2>B2,"Y","N"))

But it does not return correct answer.

Appreciate any help with this

Thanks
Time.xlsm
0
Comment
Question by:Jagwarman
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40566161
Change

=IF(E2="","",IF(E2>B2,"Y","N"))

to

=IF(E2="","",IF((E2-INT(E2))>B2,"Y","N"))
0
 

Author Comment

by:Jagwarman
ID: 40566183
Brilliant thanks
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40566192
Your time in E includes a date portion so E will always be greater than B as a result.

Phillip has given you the right answer but if you understand how date and times work in Excel it may be easier to fathom out for yourself in future.

Dates are represented by an integer number of number of days since 01/01/1900 which happened to be a Sunday and is Day 1.

Times are represented by a portion of a day ie Midday would be 0.5 or halfway through a day, 6 in the morning = 0.25, 6 in the evening = 0.75.

Therefore, midday today would be represented by a serial number of 42,027.5 eventhough you can format the cell to show "23 Jan 2015 12:00".

Knowing that dates and times behind the scenes are dealt with as numbers, it makes the maths a lot easier.

In your example, you have 12:00  (number value of 0.5) and 11:52 (number value of 42,027.49 because it includes the date portion) so the 11:52 is greater than 12:00 because of the date part, hence the result of "Y".

Hope that helps
Rob H
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

813 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

17 Experts available now in Live!

Get 1:1 Help Now