Calculating MTTR (Days) - security

What is the correct formula to calculate MTTR in Days?
MTTR = Total # of Incident in hrs/ # of incident
or
MTTR = Total # of Incident in hrs/ # of hrs in a day

It's the total time spent on unplanned repairs divided by the number of outages/incidents.
MTTR = hours of incident repairs / number of incidents.
For example, if you have spent 50 hours on unplanned maintenance for an asset that has broken down eight times over the course of a year, the mean time to repair would be 6.25 hours.
References
Mean Time to Repair Maintenance
Common Metrics

Related

Calculate total downtime hours and uptime percentage from another table in excel

The issue I am facing is regarding 2 separate tables in different tabs on the same excel worksheet.
The Table 1 below consists of a tabulated computer downtime. User have to input the date and time while the hours will be auto calculated (=(Date and time end - Date and time start) * 24)
Table 1
Computer name
Date and time start
Date and time end
Hours
A
3/9/2022 3:06:00 am
3/9/2022 3:09:00 am
0.05
B
3/9/2022 11:33:00 am
4/9/2022 9:40:00 pm
34.117
C
4/9/2022 11:33:00 am
4/9/2022 12:33:00 pm
1
C
6/9/2022 11:33:00 am
4/9/2022 12:33:00 pm
1
There's another table to consolidate all downtime in a day to show the percentage of computers running. The uptime percentage is calculated as 3 computers, A to C, times 24 hours. For example, 3rd of September have computer A and B total down time 12.5 hours so the up time was calculated as
=(24 hours * 3 computers - 12.5 hours) / 24 hours * 3 computers.
Currently table 2 below is tabulated manually base on table 1 above.
Table 2
Date
Total downtime hours
Uptime %
1/9/2022
0
100%
2/9/2022
0
100%
3/9/2022
12.5
82.64%
4/9/2022
22.667
68.52%
5/9/2022
0
100%
6/9/2022
1
98.61%
7/9/2022
0
100%
I'm trying to get table 2 to be auto filled based on table 1. Here are the following issues that I faced:
A. Unable to match date from table 2 and date time in Table 1. Tried partial match formula but did not work.
=(72-SUMIF(Table1[Date and time start], "*"&[#Date]&"*", Table1[Hours]))/72
The formula above failed due to no partial match found of the date from table 2 date time which resulted to show 100% uptime despite having downtime for that particular date.
B. Could not find a way to separate downtime hours when it was down until the next day
Computer B was shutdown from 3rd of September until 4th of September. Total downtime is 34.117 hours. Total downtime for Computer B on 3rd of September was 12.45 hours and total downtime on 4th September was 21.667 hours. I have not found a way to split 34.117 hours into 12.45 hours and 21.667 hours respectively.

How to count appearences along a timeline with criteria

I have a table with 3 columns: expense, client_id, date.
The date has record of clients expense for half a year for each day.
Some clients spend many each day, but some not.
The expendure ranging from zero to few hundreds.
I want to group/count active client, which spend over 50 dollars each day, and calculate how much clients was active between 0-30 days, 30-60 days, 60-90 days, 90-120 days, 120-150 days, 150+.
I mean if client spend at least 50 dollars each day along 40 days, i add him to 30-60 days column.
client id appears only once each day.
expense
client_id
date
20
1
01/01/2000
60
2
01/01/2020
70
3
01/02/2020
the result should be like that
0-30 days
30-60 days
60-90 days
90-120 days
9
3
12
20
the values are count of active clients
Thank you a lot
There might be better solutions with less helper columns, but this is what I can offer at the moment.
Preparation
I generated some random data in columns A to C for 10 clients, one month and an expense limit of 100. You will have to adjust the expense threshold and the day ranges to your needs.
Helper columns and formulas
criteria_met checks whether the expense is higher or equal the given threshold (here 10). Formula in D2 is =IF(A2>=10,TRUE,FALSE).
is_consecutive checks whether the client had an entry on the previous day. Formula in E2 is =IF(COUNTIFS(B$1:B1,B2,C$1:C1,C2-1)>0,TRUE,FALSE).
consecutive_group assigns a number for each group of consecutive days, on which the client had an expenditure above or equal the threshold. Formula in F2 is =IF(AND(D2=TRUE,E2=TRUE),MAXIFS(F$1:F1,B$1:B1,B2),MAXIFS(F$1:F1,B$1:B1,B2)+1). Whenever the combination of criteria_met and is_consecutive is FALSE, the group number is increased by one.
days_per_group counts the number of days per client_id and consecutive_group. Formula in G2 is =COUNTIFS(B$1:B2,B2,F$1:F2,F2).
max_per_group makes sure that only the max number of consecutive days is considered per consecutive group. Formula in H2 is =IF(G2=MAXIFS(G:G,B:B,B2,F:F,F2),G2,0).
Result table
labels creates the headline. Formula in J3 is =J2&"-"&K2-1&" days"
values counts how often a number between the given thresholds occured. Formula in J4 is =COUNTIFS($H:$H,">="&I$2,$H:$H,"<"&J$2).
Requirements
Each client can only have one entry per day
The source list (A:C) has to be sorted by date
Please let me know, if you need more information.
how to count values in K4 ?
=COUNTIFS($H:$H,">="&J$2,$H:$H,"<"&K$2)

How to get average time in Cognos 11

I am working on a data where I have to calculate average time attendance for days of the week or month
Our Data source is Cognos 11
how to get average time in Cognos 11?
Create a list with day of week, etc and your metric - calculated time
Group by day of week
Select from the swing out menu (I think it's the third option) Summarize, then choose average
Depending on the data source/database you will want to convert your start times to the lowest level (maybe minutes)
Either use a timediff function or if you have to, build it yourself (see below for suggestions on how to do that)
To build the number of minutes yourself, see if there are functions like Hour() and Minute() to deconstruct this.
Hours from time = hour([Start Time])
Take the hours and divide by 60
Add this to the minutes. Now you have total minutes
Total Minutes = ([Hours from time] * 60) + [Minute]
Take the average across the users (or whatever grouping you want) to get the average time per week
Average Minutes = average([Total Minutes] for [Work Date])
Then take the average minutes and convert that back to the time

Redistribution of remaining percentages in excel

I'm having a hard time getting some excel formulas correct. The goal is to redistribute any "lost" Change in Stake (negative values) as positive additions to other rows (the calculation is based mainly on Inactive Hours and each stackholder's original Stake
In this example, the "period" is 5 days and Row 1 controls 28.15% of the stake. so
STAKE PER DAY = 28.15% / 5
I calculate what percentage is lost during 25 hours of inactivity:
(25/24 hours) x 5.63% = ~5.86%
In this case Row 1 loses 5.86% percent for their inactivity, while all other members with lesser inactive hours than 25, get that 5.86% distributed amongst them based on their original stake. So Row 2 gets 21.93% of 5.86%, and so forth.
Stak
This formula was making my head spin last night:
=IF(B25<>"",IF(D25="YES",IF([INACTIVE HOURS] > 0, -[#[INACTIVE HOURS]]/24*[#[STAKE PER DAY]], [#[ STAKE]]/($K$40+ SUMPRODUCT([[ STAKE]],[#[INACTIVE HOURS]]/24*[STAKE PER DAY], 0))),0),"")
Stayed up real late trying to crack it but the closest I got to getting the totals in Change In Stake to sum to 0.00% (I get 0.16%) and Final Adjusted Stake to sum to 100% (I get 99.84%).
There's also more to this problem. Consider there can also be multiple rows with different values for inactive hours.
For example, the row with 28.15% had 25 inactive hours, Row with 15.71% had 15 inactive hours and Row with 12.44% had 10 inactive hours.
In that case, only 10 of those hours will be fully distributed away from all 3 of these parties, and redistributed to the parties who had 0 inactive hours. However, the stakeholder with 12.44% was only inactive for 10 hours, as opposed to the stakeholder 28.15% who was inactive for 25 hours.
Therefore, stakeholder 12.44% will lose and full redistribute 10 hours worth but will also gain some back from the stakeholders with 15 and 25 hours of inactivity, during which stakeholder 12.44% was active. Likewise, the 15 hours stackholder is entitled to a proportionate share from the stackholder who was inactive for 10 hours more than they were.
Can excel formulas handle this type of calculation? What would it look like?
I think your partial solution is complicating the underlying problem so I would propose a different method. Reading between the lines the issue is to reduce/increase each stakeholders share by the inactive/active hours.
Calculate an equivalent number of hours from the total hours (share * 5 days * 24 hrs), subtract off the inactive hours, re-base the share on the new lower total. See the image below.

Subtract time from duration only if above specified amount

Working on a timesheet (duplicate of sheet 1 in link).
The current function to handle the calculations is:
B4=6:00am
C4=6:00pm
X4=0:30:00
=IF(OR(B4="",C4=""),"",IFERROR(C4-B4-X4,""))
The thing is we don't subtract 30 minutes for lunch unless an employee works longer than 6 hours and 15 minutes.
How can I fix my function to only subtract 30 mins for lunch if the total time for that day is over 6 hours and 15 mins?
Provided there is no risk of times spanning midnight, please try:
=IF(OR(B4="",C4=""),"",IF(C4-B4>6.25/24,C4-B4-X4,C4-B4))

Resources