Solved

Time calculation

Posted on 2015-01-23
3
54 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

696 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