Hi,
I have this table with me, each record represents one file. My objective is to calculate out the duration for the file to complete.
I stuck at some files are completed within the same day, while some files might complete only after 1 or 2 or 3 days.
Are there any formulas to calculate it out?
Thanks.
You are better off with a single date and time column then use something like the below. Otherwise combine the date and time yourself first
=(TIMEVALUE(B2)-TIMEVALUE(C2)+(TIMEVALUE(B2)<TIMEVALUE(C2)))*24
I think I found a way to achieve that. Solution
First I would apologize for my unclear question. The weekdays are text format, the weekend doesn't count, and the durations are confirmed within one week period.
I actually did the below steps and achieved to my objective.
Convert all the weekdays to numbers, refer to column J and K.
Column L is the variance between column J and K. L=K-J
Then the duration M column put this formula will do.
=IF(L2=0,MOD(I2-G2,1)*24,IF(AND(L2=1,I2>=G2),MOD(I2-G2,1)*24+L2*24,IF(AND(L2=2,I2>=G2),MOD(I2-G2,1)*24+L2*24,IF(AND(L2=3,I2>=G2),MOD(I2-G2,1)*24+L2*24,MOD(I2-G2,1)*24+(L2-1)*24))))
Related
I have Time In and Time Out that need to be input on a google sheet. It has to be tracked down to the minute so I have a column for hour, minute, and am/pm. My goal is to have the amount of minutes elapsed between the time in and time out in a row.
I have not found a way to combine all three columns into a time, especially with the am/pm column in the mix. Then subsequently do a formula to find minutes elapsed. I am not well versed in spreadsheet formulas so if there is an easier way of achieving my goal please let me know.
A screenshot is attached of the google sheet columns. Thank you to anyone that can help.
Screenshot of columns :
TIME(HOUR,MINUTES,SECONDS)
That is one formula that you can use to convert integers into time in excel. I do not know if it will work in Google Sheets. I will continue with the excel solution with the assumption the formulas are the same in google sheets or there is an equivalent.
Assuming your data is layed out as per the picture below, you could use the following formulas to convert your time to an actual time that the spreadsheet can use. There are other solutions as well.
=TIME(A1+IF(AND(C1="PM",A1<12),12,0),B1,0)
That will convert your separated times into a spread sheet time. Do the same thing for the OUT Time as below:
=TIME(D1+IF(AND(F1="PM",D1<12),12,0),E1,0)+IF(TIME(D1+IF(AND(F1="PM",D1<12),12,0),E1,0)<TIME(A1+IF(AND(C1="PM",A1<12),12,0),B1,0),1,0)
That whole other part about checking the time and adding 1 or 0 is that if the out time is less, it is assuming the time is the next day. Days are represented by integers, and time is represented by the decimal value.
Now that you have a method for determine both times, subtract the larger time from the smaller time with the formula below in a single cell:
=(TIME(D1+IF(AND(F1="PM",D1<12),12,0),E1,0)+IF(TIME(D1+IF(AND(F1="PM",D1<12),12,0),E1,0)<TIME(A1+IF(AND(C1="PM",A1<12),12,0),B1,0),1,0))-(TIME(A1+IF(AND(C1="PM",A1<12),12,0),B1,0))
ALTERNATE METHOD
Convert everything to minutes, take the difference.
The first time converted to minutes will be:
=(A1+IF(AND(C1="PM",A1<12),12,0))*60+B1
The Second time converted to minutes will be:
=(D1+IF(AND(F1="PM",D1<12),12,0))*60+E1+IF(((D1+IF(AND(F1="PM",D1<12),12,0))*60+E1)<((A1+IF(AND(C1="PM",A1<12),12,0))*60+B1),24*60,0)
Now you just need to take the difference between the minutes in a single cell:
=((D1+IF(AND(F1="PM",D1<12),12,0))*60+E1+IF(((D1+IF(AND(F1="PM",D1<12),12,0))*60+E1)<((A1+IF(AND(C1="PM",A1<12),12,0))*60+B1),24*60,0))-((A1+IF(AND(C1="PM",A1<12),12,0))*60+B1)
I'm currently performing analysis on some data. Basically, sorting different product by certain variables, all this in different time frames (product flow every 30 minutes).
My date and time column looks like this: 2.01701E+11 (201701262230).
How do I refer to it?
Thank you.
Thank you for the prompt answer, but I still don't quite get how to use it. I've tried but failed.
Basically imagine I have a column with products (A, B, C, D) and next to them a column with daytimevalues that start at 13 o'clock on a certain day (201701241300) and end at 11PM the same day (201701242300). The range changes each 30 minutes.
I am trying to count all product A on the 24th of January at 13:00, and then at 13:30 and so forth:
the formula would go something like this:
=COUNTIFS(Data[Product_type], "A", Data[day_hour], ??????????)
=DATEVALUE(TEXT(A1,"0000-00-00 00\:00")) this fromula will get you the date.
=TIMEVALUE(TEXT(A1,"0000-00-00 00\:00")) this formula will give you the time.
A1 is the cell containing the input value
In the Image the column C and D contains the above mentioned formula...
=COUNTIFS($A$2:$A$10,F3,$C$2:$C$10,$G$1,$D$2:$D$10,(">=13:00:00"),$D$2:$D$10,("<14:00:00"))
you can use the above formula in cell G3 to get desired output...similarly you can use it to get other values as well.
enter image description here
You can see the situation here. Basically I have the dates under that form. I need to count the countries by occurence in time, every have hour in a given day.
I have a time diary spreadsheet that was given to me to record times taken for staff to complete different activities. Column A is the start time, column B is the finish time, where column C is the difference, using the formula B3-A3.
In row 3, this gives me answer of 0:01. Is there a way to convert this to "1" using a formula?
i.e. 0:0X becomes X
or, 0:YX becomes YX?
Thanks
MINUTE() will convert the time to time in minutes.
I'm trying to perform an AVERAGEIFS formula on some data, but there are 2 possible results and as far as I can tell AVERAGEIFS doesn't deal with that situation.
I basically want to have an ELSE inside it.
At the moment I have 2 ranges of data:
The first column only contains values 'M-T' and 'F' (Mon-Thurs and Fri).
The second column contains a time.
The times on the rows with an 'F' value in column 1 are an hour behind the rest.
I want to take an average of all the times, adjusting for the hour delay on Fridays.
So for example I want it to take an average of all the times, but subtract 1 hour from the values which are in a row with an 'F' value in it.
The way I've been doing it so far is by having 2 separate results for each day, then averaging them again for a final one:
=AVERAGEIFS(G3:G172, B3:B172, "M-T")
=AVERAGEIFS(G3:G172, B3:B172, "F")
I want to combine this into just one result.
The closest I can get is the following:
=AVERAGE(IF(B3:B172="M-T",G3:G172,((G3:G172)-1/24)))
But this doesn't produce the correct result.
Any advice?
Try this
=(SUMPRODUCT(G3:G172)-(COUNTIF(B3:B172,"=F")/24))/COUNTIF(B3:B172,"<>""""")
EDIT
Explaining various steps in the formula as per sample data in the snapshot.
SUMPRODUCT(G3:G17) sums up all the value from G3 to G17. It gives a
value of 4.635416667. This after formatting to [h]:mm gives a value
of 111.15
OP desires that Friday time be one hour less. So I have kept one hour less for Friday's in the sample data. Similar SUMPRODUCT on H3:H17 leads to a value of 4.510416667. This after formatting to [h]:mm gives a value
of 108.15. Which is exactly three hours less for three occurrences of Fridays in the sample data.
=COUNTIF(B3:B17,"=F") counts the occurrences of Friday's in the B3:B17 range which are 3 occurrences.Hence 3 hours have to less. These hours are to be represented in terms of 24 hours hence the Function COUNTIF() value is divided by 24. This gives 0.125. Same is the difference of 4.635416667 and 4.510416667 i.e. 0.125
Demonstration column H is for illustrative purposes only. Infact Friday accounted values that is 108.15 in sample data has to be divided by total data points to get the AVERAGE. The occurrences of data points are calculated by =COUNTIF(B3:B17,"<>""""") with a check for empty columns.
Thus 108:15 divided by 15 data points give 7:13 in the answer.
Revised EDIT Based upon suggestions by #Tom Sharpe
#TomSharpe has been kind enough to point the shortcomings in the method proposed by me. COUNTIF(B3:B172,"<>""""") gives too many values and is not advised. Instead of it COUNTA(B3:B172) or COUNT(G3:G172) are preferable. Better Formula to get AVERAGE as per his suggestion gives very accurate results and is revised to:
=AVERAGE(IF(B3:B172="M-T",G3:G172,((G3:G172)-1/24)))
This is an Array Formula. It has to be entered with CSE and further cell to be formatted as time.
If your column of M-T and F is named Day and your column of times is named TIME then:
=SUMPRODUCT(((Day="M-T")*TIME + (Day="F")*(TIME-1/24)))/COUNT(TIME)
One simple solution would be to create a separate column that maps the time column and performs the adjustment there. Then average this new column.
Is that an option?
Ended up just combining the two averageifs. No idea why I didn't just do that from the start:
=((AVERAGEIFS(G$3:G171, $B$3:$B171, "F")-1/24)+AVERAGEIFS(G$3:G171, $B$3:$B171, "M-T"))/2
I would like to generate a mock time series quarterly dataset from, say, 2000-2016 for a variable (quarterly credit growth) that averages around a certain value (say, 30%). Can anyone give a suggestion on how to do this in principle?
Edit: what I was implying were the actual data values for each time period, i.e. data with a certain mean and variance.
Found a solution with a code in Matlab, for anyone interested, see below in answers.
Excel approach:
You can make column A your date list. In A1, or A2 or more if you have header rows, you will have to seed your list by providing the first start date. Lets assume you put your seed date in A2. I would then go about adding 3 month to you start date using a formula, and copy down until you have hit your desired date. In order to add the 3 months I would use the following in A3.
=date(year(A2),Month(A2)+3,day(A1)
that will give you the first day of the month every 3 months. If you want the first day of the month every 3 months, set the day to 1 like so:
=date(year(A2),Month(A2)+3,day(A1)
And end of month could be calculated as:
=eomonth(date(year(A2),Month(A2)+3,day(A1)),0)
however I would prefer to do the end of month calculation based on the row you are in so I would do it more like:
=EOMONTH($A$2,(rows($A$2:A3)-1)*3)