Solved

Time calculation

Posted on 2015-01-23
3
55 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 33

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
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.

705 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