Calculating SLA in Excel with time stamps - excel-formula

I am having a trouble in setting up an excel sheet for calculating SLA for my process, we have daily e-mails which needs to be processed within 48 hours and task is to find which are the e-mail which are exceeding this 48 hours TAT. From the export we have, Activity(E-mail code), Received date, Planned End Date, and Actual End Date. So I made a sheet with these variables and I made a column to find difference between the Planned End Date and Actual End Date (i.e PED-AED) and check if the values is greater than 48 hrs. But I have an issue in calculating the values during friday, because the Planned End Date will be 48 hrs(2 Work days) but excel calculates it as 96 hrs (Saturday, Sunday, Monday, Tuesday). Due to this it is showing more than 48 hrs and messing up my sheet. So my question is, is there any way to show the exact 48 hrs in excel by eliminating saturdays and sundays? I am using Countifs for this purpose, kindly help me. I can give more info on this. Thanks in advance

Please try this in your formula,
=NETWORKDAYS(A1,B1)
A1 and B1 should contain the 2 dates. This formula will count only the working days of the week excluding weekends. Let me know if you need more info.

Related

Count worktime for current month only

I would like to ask for a bit of help, as I can't figure it out myself.
What I would like to end up is, get the total calculation of the work time hours for each name only for the month written in A5 cell.
So far I used this code to have the start date Monday, based on the date in A5 cell.
=A5-MOD(A5-2,7)
With this community help I ended up with this code to count the work time for each name in the week (lots of students in the schedule)
=SUMPRODUCT(IFERROR(TIMEVALUE(MID(C7:H7,FIND("-",C7:H7,1)+1,LEN(C7:H7)-FIND("-",C7:H7,1))) - TIMEVALUE(LEFT(C7:H7,FIND("-",C7:H7,1)-1)),0))
The help I need, if it's possible, is to figure out how to get the total work time only for the month entered in cell A5 (which is 1.october - 31.october) without counting the last 3 days in September. I plan to use this spreadsheet for the following months as well. I tried to use COUNTIFS, but no luck so far. Also, I am using an online excel version, which is very limited in the menu.
Thanks in advance for any help.
=TEXT(c6, "mmm") will give Sep, while TEXT(A5, "mmm") will give Oct. You need to SUMIF the month matches.
You could incorporate this together with the equation you already have but I think it might be easier to create a duplicate table below the main table, copying the day of the month and the names and using your above mentioned equation to get the hours to be summed.
Either above or below the date, or instead of the date, I'd pull out the month with =TEXT(C6, "mmm")
Lets say the duplicate table for cells B16-I12 was in cells B106-I112 with the extra row specifying the month above this in row 105 (=TEXT(C106, "mmm") etc.).
Then in cell D24, you'd have
=SUMIF(C$105:I$105,TEXT($A$5,"mmm"),C107:I107) +[same again for the next week, cells B15-I21] + [same again for the next week] etc.
This can then be copied down for all the names.
You could also feed this information up into cells K7, K8,K12, becuase you only need this for the first and last months. So J6 would read 'hours this week' K6 would read Hours last month, L6, hours this month. Then D24 could sum L7 and J16 etc.

COUNTIF formula using variable dates

Morning all,
Let me explain my predicament! I'm putting together a set of reporting figures for my employer based on a spreadsheet containing work that's been completed so far this year. I need to report on the total volume of work completed and the average turnaround for this work, split by Week to Date, Month to Date, and Year to Date (WTD, MTD, YTD).
This is something i've put together manually so far but i want to produce a formula which allows my employer to generate his own figures based on a week-ending date he can pick from a dropdown list (held in cell D4).
So far i've been able to generate the below COUNTIF formula to give me the WTD figures for work volumes completed within 7 days of the week ending date in cell D4 (with the completion date being held in 'Completed!O:O'):
=COUNTIFS(Completed!$O:$O,">="&D4-6,Completed!$O:$O,"<="&D4+1)
I'm also using the below AVERAGEIF formula to show the average turnaround (the Turnaround figure is held in 'Completed!P:P'):
=AVERAGEIFS(Completed!$P:$P,Completed!$O:$O,">="&D4-6,Completed!$O:$O,"<="&D4+1)
I've been trying to come up with similar formulas to tell me the MTD and YTD figures but with no success. I originally had the MTD formula return the value based on work completed within 31 days of the Week-Ending date but this was incorrect. If the week-ending date of 03/02/2017 if selected then i only need it to show the count of work completed between the 1st and 3rd of Feb. I'm sure once i work this one out that i'll be able to use a similar formula to show me YTD figures.
Any help or guidance you can offer is appreciated! Cheers.
For the MTD count, use:
=COUNTIFS(Completed!$O:$O,">="&DATE(YEAR(D4),MONTH(D4),1),Completed!$O:$O,"<="&D4+1)
For the YTD count, use:
=COUNTIFS(Completed!$O:$O,">="&DATE(YEAR(D4),1,1),Completed!$O:$O,"<="&D4+1)
For the MTD average, use:
=AVERAGEIFS(Completed!$P:$P,Completed!$O:$O,">="&DATE(YEAR(D4),MONTH(D4),1),Completed!$O:$O,"<="&D4+1)
For the YTD average, use:
=AVERAGEIFS(Completed!$P:$P,Completed!$O:$O,">="&DATE(YEAR(D4),1,1),Completed!$O:$O,"<="&D4+1)
a fellow helpful user has assisted and i now have formulas that work.
For MTD, i'm using the following:
=COUNTIFS(Completed!$O:$O,">="&EOMONTH(D4,-1)+1,Completed!$O:$O,"<="&D4+1)
And for YTD:
=COUNTIFS(Completed!$O:$O,">="&DATE(YEAR(D4),1,1),Completed!$O:$O,"<="&D4+1)
Thanks for everyones help!

Calculate stock duration from today

I have a spreadsheet which shows me the inventory of my stock.
Product name Qty Average orders/month Stock available until:
Product1 100 10 xx/xx/xxxx
I would like to calculate, using today date, the estimated date my stock will be at 0.
In this example I have 100 / 10 = 10 month from today.But how can I get the date difference? ie convert 10 months from now into a date
Also I know how to change background color according to specific values of the cell, but how can I do the same for the amount of days between today and the estimated date?
Thanks for your help
=date(year(today()),month(today())+10,day(today())
The above formula we put you on the same calendar date that is 10 months after the current month. The number of days between today and that day 10 months from now will vary as the number of days in a month changes. You will also get some slightly unexpected results when you try to find the 30th day 10 months from April since February only has 28/29 days. it will actually tell you early march which is technically 11 months away.
Where you see 10 in the formula above, replace it with your equation that will calculate 10
Since you will be dealing with fractions of a month, you will need to determine a way that suits your needs to convert that into number of days. My personal recommendation is you treat every month as having 30 days. so 10.5 months is really 10.5*30=315 days. So the formula above would become:
=today()+315
or
=today()+10.5*30
So in this case replace either the 10.5 with your formula that calculates months or replaces 315 with your formula that converts fractions of a month into days. Note days will need to be an integer so consider rounding your results ROUND(results,0) or INT(results).
As for changing your cell colour based on conditional formatting, lets assume your end date is in the D column. Select the range in the D column making sure your active cell is D2 (by default this would be the cell with the white background and is the first cell clicked on to start the last selection drag). Go into your conditional formatting and select formula ando for your logicinal condition to return true you and have the colouring take effect you want to use a formula like:
=D2-today()<=21
That should evaluate true or false.

Retrieve cell value based on date Excel

I'm working on a time sheet for my work schedule. In column A I have the start dates of each week. In the second column I have how many hours I work that day. I am payed on the 22nd of each month. I want to have a running total of how much I have earned in a month before payday. That is to say on the 21st I know how much money I will be paid the next day from my spreadsheet.
I want to SUM the values of column B but only for the weeks which lie between the 22nd of 'April' lets say and 'May'.
Therefore based on the value of the start date of the week, I need to obtain the information adjacent to the weeks, for a set of weeks and sum it to find the number of hours I've worked this paying month. I want this to happen automatically, so it will change automatically.
I have attached a screenshot which might make this clearer, I have added a couple of other names as additional variables.
Thank you in advance,
Maksim Richards
If the amounts that you'll get in next month's pay haven't been filled in yet (which is the question you're asking because you want to find out on 21st May how much you will be getting) then you just need to sum the amounts for the weeks starting 22/4/16 onwards in G9:-
=SUMIF($A$4:$A$11,">="&DATE(YEAR($F$2),MONTH($F$2)-1,$G$2),B$4:B$11)
where today's date is in F2 and payday in G2.
Then the pay so far is:-
=G9*24*$H$2
where the hourly rate is in H2 (result may appear formatted as date: if so, change format to general).
If you wanted to check back after some of next month's hours had been put in the spreadsheet and see if what you've actually been paid is the same as your calculated pay you would need a SUMIFS:-
=SUMIFS(B$4:B$11,$A$4:$A$11,">="&DATE(YEAR($F$2),MONTH($F$2)-1,$G$2),$A$4:$A$11,"<"&DATE(YEAR($F$2),MONTH($F$2),$G$2))
I haven't used TODAY to get today's date because it's volatile and if you use it, it will keep prompting you to save the spreadsheet when you close it even if you haven't changed anything.

Count the number of hours within a certain range on excel

I am wanting to enhance the functionality of my time sheet. I want to calculate if a person's hours falls into a range, and if so, count how many hours. For example:
A user clocks in on their time sheet:
Tuesday: 05:00 - 04:00 i.e. - They worked 23 hours.
From the above time, I want to count how many hours they have worked between the time range 19:30 - 07:30.
Manually calculating this works out at 9.5 hours - or 09:30.
Many thanks.
Formula:
=IF(ClockOut<RangeStart,0,IF(ClockIn>RangeEnd,0,IF(ClockOut<RangeEnd,ClockOut,RangeEnd)-IF(ClockIn>RangeStart,ClockIn,RangeStart)))
This is what is working for me in all the cases I've tested:
Data cells:
A1: Range start | B1: Range end
A2: Clock In       | B2: Clock out
Formula:
=IF(B2<A1,0,IF(A2>B1,0,IF(A2<A1,IF(B2>B1,B1-A1,B2-A1),IF(B2>B1,B1-A2,B2-A2))))
The result is in days, so if you want it in hours, just multiply by 24.
=IF(B2<A1,0,IF(A2>B1,0,IF(A2<A1,IF(B2>B1,B1-A1,B2-A1),IF(B2>B1,B1-A2,B2-A2))))*24
If the times span more than one day, it's crucial for this to work that the cells include the date. In Excel, if you just enter the time, its (fake) date is 00/01/1900, so for the ending times to have the appropriate date, I specified the next day: 01/01/1900. Therefore, if you only have the time, you will have to do this as well.
But if you get a full DateTime from, for example, a database, then you won't have this issue, but you will have to modify the range cells to have the corresponding dates, or modify the clock cells to convert the date back to 00/01/1900, depending on your scenario. Please give some more details if you need help with this.

Resources