Multiply hh:mm with number in excel - excel

I have a total of hours in hh:mm format and I need to multiply it with hourly rate for example 22$ per hours. How can I achieve this in excel?
Expectation is since its 49:30 hours, it should perform below formula 49:50 & 22 = 1089

Convert the hh:mm format to timevalue and multiply by 24 (because 1 = 1 day), and then multiply by hourly rate: (Assume hour data in A1)
=(TIMEVALUE("00:00:00")+A1)*24*22

Related

Convert Days, Hours, Minutes to Seconds (Dd HH:MM:SS) in Excel

How can i convert cell in excel to seconds
Example:
2d 07:51:00
Expected Output:
201060
If one has TEXTSPLIT:
=SUM(--SUBSTITUTE(TEXTSPLIT(A1," "),"d",""))*86400
Else:
=(SUBSTITUTE(LEFT(A1,FIND(" ",A1)-1),"d","")+MID(A1,FIND(" ",A1)+1,LEN(A1)))*86400

How to convert UTC to PST in Excel for day and time formats?

In excel, I have a cell which is
13 05:58:57
which represents day 13, 5 am, 58 minutes, 57 seconds in UTC time.
I would like to convert to PST, which should be
12 10:58:57
which is day 12, 10 pm, 58 minutes, 57 seconds.
The day is just a day of the month. Is there a way to do this quickly in excel?
Excel stores date_times as numbers, where each day is 1, and the decimal part of the number is the time (so 0.25 is 6 hours, and 0.7 is 16 hours + 48 minutes)
Time 0 is the beginning of 1899/12/31, so =today() formatted as a decimal currently shows me as 44730.4556, being 44730 days since 1899 and almost eleven a.m.
Once you have your data in that format it is trivial to E.g.:
subtract 7 hours = A2 - 7/24
add 2 days 6 hours and 15 minutes = A2 + 2 + 6/24 + 15/24/60
find the difference between two date_times
So you want to get the input data into that form, from which point you just use formatting.
To see where you are going, enter in A1 = now(), in B1 =A1, in C1 = B1.
Change the format on B1 - Right Click | Format Cells | Custom | yyyy-mm-dd hh:mm:ss.
Then in C1 try changing to a format you want: dd hh:mm:ss AM/PM.
For a full list of options see https://support.microsoft.com/en-au/office/format-numbers-as-dates-or-times-418bd3fe-0577-47c8-8caa-b4d30c528309
I will assume that your data starts at A4, but I can't tell what is actually stored in the cell, as opposed to what it displays.
If your input data is actually already a date_time (what does it look like if you format is as a decimal?) all you need to do is =A4-7/24.
If your input data is actually a string, then separate it into day, hour, minute, second in C, D, E, F.
If single-digit days have leading zeros then just =left(A4,2) then =mid(A4,4,2) etc.
If there are no leading zeros put in column B =find(" ",A4) and point the lefts and mids to that intermediate result.
Then in G put = C4 + D4/24 + E4/24/60 + F4/24/60/60 so you have the input data as an Excel-formatted time.
And subtract the 7 hours difference with =G4-7/24
P.S. If you need to cope with month-ends and DST then you need to add year and month to the data in G - currently it has date_times in January 1899.

Spotfire AVG value per hour

I have users that have random values per hour across 24 hours. I want to get their average value per hour as it increases. Such as: a value of 3 at 3pm, then 4 at 4pm, 5 at 5pm, find the average per hour and give the total average once there are no more timestamps.
I've tried this:
case
when (DatePart("hour",[AUDIT_TSP])>0) and (DatePart("hour",[AUDIT_TSP])<1)
then Date([AUDIT_TSP]) & " " & ":00" & ":00" & Second([AUDIT_TSP])
when (DatePart("hour",[AUDIT_TSP])=1) and (DatePart("minute",
[AUDIT_TSP])>0) then Date([AUDIT_TSP]) & " " & ":01" & ":00" &
Second([AUDIT_TSP])
else null end
This was based off of sporfire: calculate the avg per 15 minutes and I tweaked it for my use but couldn't get the code to show the avg hour and not 15min avg. So I figured to ask here.
My AUDIT_TSP is formatted with DateTime and example values look like:
4/15/2019 6:16:59 AM
4/15/2019 6:20:05 AM
The values are just shipments so, 1 shipment an hour, 2 shipments an hour, etc. Just trying to get the average per hour.
I don't expect the average per hour to show up on the timeline, the values it's showing here is the amount of shipments for each hour. If the average can be shown on the timeline, then great, if not, then I can audible and show it in a textbox if that's possible as well.
You could produce an intermediate column to mark each hour with
[hourBin] calculated as: Integer(ToEpochSeconds([time-stamp]) / 3600)
Here [time-stamp] is your timestamp column. ToEpochSeconds(..) counts the number of seconds from a reference date (usually 1st Jan 1970). When you divide it by 3600 and take the integer part, you get an hour counter.
Then average your values for each hour
Avg([value]) OVER ([hourBin])
And/or visualise the average and the spread around it in a box-plot of [value] with [hourBin] as the category.
If you want the intermediate column to look more meaningful you can rescale it by its first value so it starts from 0 (or add any number you wish):
Integer(ToEpochSeconds([time-stamp]) / 3600) - Min(Integer(ToEpochSeconds([time-stamp]) / 3600))

Excel Time Comparison and Subtraction

I am trying to do a time subtraction in excel of 30 minutes and I am running into a speed bump. So the table I have are as follows.
Table "Schedule"
Column 1 is day of the week (Mon-Sun) (formated as general, as this is plain text)
Column 2 is start time of the shift (formated as h:mm AM/PM)
Column 3 is end time of the shift (formated as h:mm AM/PM)
Column 4 is duration of the shift (start to end) (formated by formula (TEXT(col3-col2,"h:mm")) )
Column 5 is paid hours (if the total hours is over 6.5 then subtract 0.5 hours for an unpaid lunch) (formula IF(col5>"6:30",col5-"0:30",D5) )
The issue is any time allotment over 10 hours start to end (where column 4, the duration hits 10 hours) no lunch is subtracted at all.
So...
Start 9:00 AM, End 6:59 PM, Hours Total 9:59, Hours Paid 9:29
But...
Start 9:00 AM, End 7:00 PM, Hours Total 10:00, Hours Paid 10:00
and that should obviously not happen. I can't find anything on google so I figured the excel gurus here may have some advice.
Thanks!
If your time columns are stores using excel's dedicated time format, this should be straightforward. Mixed data types are likely your problem.
First, be sure your time columns (columns 2 and 3) are set using the time function, i.e.,
=time(hours,minutes,seconds)
Then, you should be able to add and subtract easily.
Column 4: = column 3 - column 2
... then subtract 30 minutes also using the time() function:
Column 5: = if(column 4 > time(6,30,0),column 4 -time(0,30,0),column 4)
Excel stores time values from 0 to 1. So 24 hours=1, 12 hours=.5 etc. That means 6.5 hours=0.270833333 and .5 hours=0.020833333. As a result you can just do a simple if statement.
=IF(D2>0.270833333,D2-0.020833333,D2)
To turn it into a time format, is to just use excel's time formating options.

Derive an End date by Man hours and a start date in Excel-2010

I need a formula which calculates the End Date (with Time) when total Man Hours and Start Date are given. [Excel 2010]
Criteria:
1 Man Day = 8 Hours (1 hour is break time)
Work Start Time = 10:00
Work End Time = 19:00
1 Man Week = Mon - Fri
Holidays, if any, should not be counted
For example:
Cell E7 = Man Hours = 10 Hrs
Cell F7 = Start Date = 26-Jun-15 13:00
Cell G7 = End Date = ???? (Ideally 29-Jun-15 14:00)
*27th and 28th are weekends
Thank you!
margin of error for the estimate of duration from estimate of effort is too big for an hourly granularity to make any sense as long as real people and realistic plans are concerned
however, if we have an estimate of duration in working hours on the input (as opposed to calendar days/weeks/months which are more common units of duration estimates) and we need to calculate the end date-time, we could:
compute helper column with the would-be end hour if there were no closing hours (e.g. in cell H7, in Excel Date units = fractions of a day)
=MOD(F7, 1) + MOD(E7, 8)/24
check if the would-be hour is before the closing hours and adjust the end day + end time accordingly. If it's after, move to the next workday and adjust time, e.g. for simplicity assume all breaks are at the beginning of a day, so we can subtract the number of hours in a workday:
=IF(H7 <= 19/24,
WORKDAY(F7, E7/8, holidays) + H7,
WORKDAY(F7, E7/8 + 1, holidays) + H7 - 8/24)
assume you saved your national holidays on column I, you can try below in cell H7:
=IF(HOUR(F7+E7/24)>19,((F7+E7/24)-INT(F7+E7/24)-0.792)+(WORKDAY(F7,1,I:I))+0.417,F7+E7/24)

Resources