Conditional Formatting with Time through Formula - excel

I'm trying to highlight the time based on the folowing rules
If the time is lower than 7:30 be closer to red
Otherwise if the time is closer to 8:05 get close to green
In this sheet:
I guess it's easier to explain with the following illustration:
You should get the basic idea of what I'm trying to accomplish with the formulars in the formatting rule picture. That one however doesn't work.
Any ideas what would be the proper way to format this rule?

On the left side for value write 0,31 and on the right side write 0,34.
To get the correct value, that is corresponding to the correct time, simply select the time in Excel, using the Time() formula, press Ctrl+1 and select Number. You will see the correct number for the time.

Also found a way, albeit this is more of a workaround:
You can enter the values as a raw number in format of AB:CD:EF (or depending on the time format you are using) and excel will automatically format the rule somehow with decimal signs, although this really is more of a workaround rather than answer to the actual question

You can use "industrial minutes", minutes to a base of 100 industrialseconds. Then you can use standard decimal values.
In excel you simple multiply time values by 24 to get to that. Then 30 minutes are 0.5 of an hour.
For the conditional formating use a 3-Color scale and set the middlepoint to number 7.5 and a lighter green.

Related

How to fill down time tracker if having only start & End MM:SS

Having Excel where I get required hourly down time with only having start & end date time as per the images required any formula or vba command for calculation.
Please, notice you are mixing different types of data in your output. Value 03:39 is a time value while 60,0 or 0,0 is decimal. You should consider working all of them in decimal if you are going to make any calculations.
Also, you could play with CF rules to see the values as you wish, but real value should be decimals.
Anyways, I managed to do it with this:
=IF(HOUR($A2)>HOUR(C$1);0;IF(HOUR($A2)=HOUR(C$1);TEXT("00:"&MINUTE($A2)&":"&SECOND($A2);"mm:ss");IF(HOUR($B2)>HOUR(C$1);TEXT(60;"0,0");IF(HOUR($B2)=HOUR(C$1);TEXT("00:"&MINUTE($B2)&":"&SECOND($B2);"mm:ss");TEXT(0;"0,0")))))
Drag to right and bottom.
Notice I'm forcing the format with the TEXT function, so the output is not numeric but a text so you cannot do any calculus with it. That's why you should consider using CF rules
Also, depending on your regional setup, masks like mm:ss or 0,0 that I use in the formulas may be different in your PC

Averaging production percentages (Hourly) based on different values for a total for the day?

I'm trying to add a daily average of the hours used vs the items completed. The problem is, some items are done by how many there are to do (e.g. 5 EA) and some are based on feet to install (e.g. 100 FT). Here is the link to an image that should help to clarify what my post doesn't say well.
I'm not sure how to best accomplish the above with a formula I can use within "Conditional Formatting" to highlight the cells in green, yellow, or red based on the day's totals.
Below is the formula that I have attempted to use to achieve my goal but I have a feelings that it is wrong as the results don't seem to add up to me (in F:41, I feel that that should at least be yellow and not red). I'm sure that I am missing something simple, but I just don't know what it could be.
=F41/(SUMPRODUCT($G$18:$G$38,$X$18:$X$38)/($X$18:$X$38))>0.95
=F41/(SUMPRODUCT($G$18:$G$38,$X$18:$X$38)/($X$18:$X$38))>=0.9
=F41/(SUMPRODUCT($G$18:$G$38,$X$18:$X$38)/($X$18:$X$38))<0.9
As my formula above says, I'm trying to color based on the value being greater than or less than a certain percentage. The colors are explained in the image attached.
I'm honestly at a loss as to the best way to handle this, and it may be that I am over thinking it honestly. I've been known to do that on more than one occasion.
Note: The hours are not all worked in one day, but I was testing a variety of cells to make sure my formula carried correctly. Hours are based on (2) people working an 8 hour day for a total of 16 hours per day (hence the odd look there).
The formula below is what ended up working. It took a bit of time, but I did get it working.
=SUMPRODUCT(G18:G38,1/X18:X38)/F41>0.95
=SUMPRODUCT(G18:G38,1/X18:X38)/F41>=0.9
=SUMPRODUCT(G18:G38,1/X18:X38)/F41<0.9

Excel function for First Row and Last Row of group

I have a gate keeping report with a number of entry/exit times for an employee over a 24hr period.
I need another formula to go into I40 which is the difference between the first entry time - last entry time for each employee eg. I40 = F50 - D40.
Dont worry about the formula regarding the subtraction of dates as I have this. I really just need the formula that will allow me to get the Last Exit time cell and the First Entry time cell for each employee.
The best way is to always store datetime values (ie, 2018-05-24 13:454) instead of just the times. You could still display it as a time by changing the cell's formatting to a time format.
Shortcut to Number Formatting options: Ctrl+1
There are many advantages, including that "regular math" will still work even if a shift starts in a different day than it ends.
If you must stick with only times, you can still calculate it correctly (up to a 23.9-hour shift) with an IF statement to add a day if the returned value is negative.
For example, if your existing formula works for same-day shift, and is:
=F50-D40
...then you could change it to:
=IF(F50-D40<0,F50+1-D40,F50-D40)
More Information:
Office.com : How to use dates and times in Excel
Office.com : Add or subtract time (Excel)
EDIT:
Looking at your question again, perhaps I misunderstood what you were trying to ndo. It's a little unclear, but you mention the fist and last times.
If you mean the "earliest and latest", you can get those using MIN and MAX. If the crossing-midnight is an issue here too, you'll need to see my first suggestion above, or else add a "helper column" to determine which times are before which.
Storing datetime is still best and this all would have been avoided.
try the below to get the difference in hours.
=(E50+F50)-(C40+D40)

EXCEL - Substract two 24hr time format cells with seconds and miliseconds

Okay, so I have two cells:
Start End
11:31:37.644 11:31:51.269
I'd like to subtract the two and return the remaining time which should equal something around 14 seconds.
Edit for more information:
My values I'm inputting are like so:
113137.644
113151.269
and I have a custom formatter set to: 00\:00\:00.000 to display what you see at the very top.
It would be better if you could input the values as real time values then you can just use a simple subtraction
=A2-A1
...but with the values as they are you can do a conversion and subtraction all in one using TEXT function, e.g. in A3 use this formula
=TEXT(A2,"00\:00\:00.000")-TEXT(A1,"00\:00\:00.000")
format A3 as [h]:mm:ss.000 to get 0:00:13.625 for your example
Assumes times are on the same "day", if you need to pass midnight you can revise formula to
=MOD(TEXT(A2,"00\:00\:00.000")-TEXT(A1,"00\:00\:00.000"),1)
You need to use the MID function to grab each section of the time, like this:
=MID(A1,1,2)&":"&MID(A1,3,2)&":"&MID(A1,5,2)&"."&MID(A1,8,3)
This will change 113137.644 to 11:31:37.644.
You can then do the math on it like this (all in one cell, but broken up here for readability):
=TEXT(MID(B1,1,2)&":"&MID(B1,3,2)&":"&MID(B1,5,2)&"."&MID(B1,8,3), "hh:mm:ss.000")
-
TEXT(MID(A1,1,2)&":"&MID(A1,3,2)&":"&MID(A1,5,2)&"."&MID(A1,8,3),"hh:mm:ss.000")
That should give you 0.000157697. Change the field's custom format to hh:mm:ss.000 to give you 00:00:13.625.
You can use this formula to convert your values to time
=(LEFT(A1,2)+(MID(A1,3,2)+RIGHT(A1,LEN(A1)-4)/60)/60)/24
You can then subtract and convert back using the following formula
=TEXT(B1,"hhmm")&TEXT(MOD(B1*24*60,1)*60,"00.000")
But it would probably be better for you to actually use proper decimal values in fractions of days or hours rather than this you can't calculate anything with.

MS-Excel Negative times

I'm writing a spreadsheet for a shop manager. What it does is keep track of the number of hours a worker has worked.
So you enter times for Monday-Sunday, and then an adjustment - e.g. if they work 40/40/40/32 hours for the month, then you would have an adjustment of -2/-2/-2/+6 to bring the worker to the 38 hour week that he's being paid for. Some (most) weeks may be adjusted for overtime. The spreadsheet then totals the hours.
This spreadsheet is supposed to just be a self-calculating version of a paper form.
It needs to match the paper form as it has to be substituted for the old form which is given to some other member of the company (pay clerk, I don't know; I'm not rebuilding their whole system, just replacing a form)
I'm having trouble entering a negative time in the adj field - the field has a [h]:mm formatting. and when i enter a negative time (e.g. -2:00) it displays an error, saying "incorrectly formatted equation", with the suggestion that if I was entering a string then I should prefix with a apostrophe.
How do I overcome this?
Tools - Options - Calculation - 1904 date system
Check this box to use the 1904 (Mac) date system and you will be able to use negative dates and times. I'm not sure how this will effect existing spreadsheets, so maybe someone else can speak to that.
According to Excel...
"Dates and Times that are negative appear as ########"
Doesn't sound like you're going to be able to do that with an auto-summation formula. You'll have to set the formatting as none and just type it in (which defeats the purpose).
I am solving the same problem. Setting for date formatting "1904" is necessary for both below described solution.
You can enter an equation as a result of predeceasing cells like C5-C4-C3 (check out-check in-standard working time). The result is negative and it will be displayed like -1:15 and you can further process it.
Second way was already described above - to put into the requested cell a negative decimal value as a fraction of "1". "1,000"=24 hours, "0,5"=12 hours, "0,01"= 14 minutes, "0,041667"=1 hour. You have to find the correct decimal numbers first.

Resources