Math comparison and time

  • Thread starter Richard Lewis Haggard
  • Start date
R

Richard Lewis Haggard

I am using a spreadsheet that my client wants filled out to track time spent
on various projects. I want to highlight cells where elapsed time as
calculated from time in/out doesn't agree with the sum of time for projects.
I know how to do a conditional format to make the cell display its text in
color but I'm having trouble getting the calculation comparison right. The
problem is that the cells that contain the time in/out are formatted to
contain time as hh:mm but the time spent on the various projects is a number
that represents hours expressed as a decimal.

As an example:
Asumme that the In time is 8:30
the Lunch Out time is 12:00
the Lunch In time is 12:30
the Out time is 17:00

The time for Project 1 is three and half hours and so is entered as 3.5
The time for Project 2 is four and a half hours and so is entered as 4.5.

Summing the project time gives 8.0.
(Lunch Out - In) + (Out - Lunch In) = 8:00.

The spread sheet has a cell that is the sum of the individual project times.
I want it to display as red when this value is different from the elapsed
time from the various in and outs for the day. How to I generate the
appropriate value to compare against the cell whose value is generated from
the sum of the project elapsed times?
 
T

T. Valko

To compare formatted TIME to a decimal value you have to either multiply the
formatted time by 24 or divide the decimal value by 24. I prefer the former:

A1 = 40:00 (formatted as [h]:mm)
B1 = 40 (decimal value formatted as GENERAL or NUMBER)

=A1*24=B1

=B1/24=A1

Both results are TRUE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top