Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional formating for time

Status
Not open for further replies.

Parsnip

Mechanical
Apr 30, 2003
46
All,
I have a spreadsheet that calculates the amount of hours worked each week. I am able to calculate the amount of variance between what was worked and the standard. My problem is I want to show if this varaince is +ve or -ve.
For example
Standard hours = 37 in cell A1
Hours worked = 35:25 in cell A2
Variance = if(A2*24<A1,A1-a2*24,A2*24-A1)/24
and hece I get 1:35 as my answer which is correct. Now I want to use conditional formatting by turning the cell red to show that this is under the required hours - HOW??
All help would be appreciated.
Regards

[smarty]
 
Replies continue below

Recommended for you

I suggest you do the following:
In A1 enter 37:00 (so it will be automatically converted to a time value, like your entry in A2). The value will be 1.54166666666667, to be precise (which is the number of days).
In the variance cell, A3 for example, you write the formula =ABS(A1-A2), and format it as time (hh:mm:ss).
In the variance cell, choose Format|Conditional Formatting and select Formula Is from the drop down box, and type =A2<A1 in the formula box. Select the format button to specify the cell formatting in case the hours worked (A2) are less than the required hours (A1).


Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor