How do I count how many occurrences per week something happens excel? - excel

I am looking at a rather large excel spreadsheet with a long list of dates on it. Each one of these dates marks an error. What I am trying to find out is how many errors occur per week? From there I hope to make a control chart. Thanks so much and please let me know if there are any additional details I need to provide.

Just Like TMH8885 metioned get week number from each date and then assuming that your dates are in Column A and weeknumbers are in column B make a table that list numbers from 1 to 52 next to which enter a COUNTIF(B:B,D2)(change D2 to cell pointing at correct week number of course).
In the screen shot I was lazy and included only 22 weeks for my table.

You could use the WEEKNUM function to pull which week of the year the error occurred in.
=WEEKNUM(your date cell)
From there you could use a pivot table to pull in the weeks then find the average count of errors.

Related

To find number of hours between start date and end date in excel or power bi?

I have a data having two date columns. SHUT HOURS column I calculate after subtracting FEEDON from FEEDOFF date. I need the information for number of shut hours on each day. If I just subtract FEEDON from FEEDOFF, it will give me total number of hours for all days. But I want for each day. Is there any way where I can find number of SHUT HOURS on each day from FEEDOFF and FEEDON date?
The output I want is in the following picture. For example, for first row I want all dates in different cells corresponding to different number of hours. Is there any way to do that?
This is ARRAY (CSE) formula. Press Control+Shift+Enter after pasting the formula.
Formula in G1 is
=ABS(IF(COUNTIFS($A$2:$A$4,"<="&E1+86399/86400,$B$2:$B$4,">="&E1)>0,1,0)*IFERROR(IF(MATCH(E1,INT($A$2:$A$4),0)=MATCH(E1,INT($B$2:$B$4),0),INDEX($B$2:$B$4,MATCH(E1,INT($B$2:$B$4),0),1)-INDEX($A$2:$A$4,MATCH(E1,INT($A$2:$A$4),0),1),""),IFERROR(INDEX($A$2:$A$4,MATCH(E1,INT($A$2:$A$4),0),1)-E1-1,1)*IFERROR(INDEX($B$2:$B$4,MATCH(E1,INT($B$2:$B$4),0),1)-E1,1))*24)
Pasting again being too long to scroll
=ABS(IF(COUNTIFS($A$2:$A$4,"<="&E1+86399/86400,$B$2:$B$4,">="&E1)>0,1,0)*IFERROR(IF(MATCH(E1,INT($A$2:$A$4),0)=MATCH(E1,INT($B$2:$B$4),0),INDEX($B$2:$B$4,MATCH(E1,INT($B$2:$B$4),0),1)-INDEX($A$2:$A$4,MATCH(E1,INT($A$2:$A$4),0),1),""),IFERROR(INDEX($A$2:$A$4,MATCH(E1,INT($A$2:$A$4),0),1)-E1-1,1)*IFERROR(INDEX($B$2:$B$4,MATCH(E1,INT($B$2:$B$4),0),1)-E1,1))*24)
Got help from this link
This will fail if the dates are overlapping as in case of your fourth row is overlapping the first and the third.

How do I sum a total number of occurrences of a ID number with a specific month and year in Excel

I have a Excel Master sheet where I am looking to query other sheets within the workbook. What I am trying to do is see How many occurrences of an ID for a Project in a column occur within a month, e.g. how many times does the ID 1367 occur in November. My dates are in the format of e.g 13/11/18 and this cannot be changed as I am just creating a report against a workbook I do not own.
The relevant columns I need are formatted like so:
Project: Project ID: Date:
a 123 1/01/2018
a 123 2/01/2019
a 123 3/01/2018
a 123
This is my SUMIFS function:
=SUMIF(PPlanner!$D:$D,Dashboard!$B$6,PPlanner!X:X)
This works by itself. My problem is trying to get the ID total for a specific month.
It returns the number of occurrences the ID occurs against a project all together but not against the month specifically. I have tried adding syntax to specify
the month but I am getting errors such as "too many arguments".
I recently answered a question that was very similar :
Excel - Take Average of Monthly Data
I think this would answer your question as well, but you have to use COUNTIFS instead of AVERAGEIFS
As for presentation, I would make a separate list of the months you want to include, and put the formula next to it, instead of the formula next to the actual list of data (as in the other question). As for how to write/input the month, you can put it any way you want, as long as it is a valid date in Excel. With the cell formatting you then can show it as month and year only. This is just to say that a text input JANUARY 2018 does not work (in a normal cell, eg. a cell that you did not format as text, when you type that into the cell, Excel recognizes this as a date, and will actually put 1/1/2018).
Oh, and using a Pivot table would work as well, the other answer on the question referenced above also explains how to do that.
In some cases, how Excel handles dates is very convenient.
For you, the date format doesn't matter. It is simply a number counting days with 0 being December 31st, 1899.
13/11/18 the date is the integer 43417 in-cell value. Excel interprets this as a both date and time together. The whole numbers are the days while the decimals are the time of day as a fraction of the day. 43417.5 would be noon.
So you may use COUNTIFS to help here.
=COUNTIFS(PPlanner!$X:$X, 1367, PPlanner!$D:$D, ">"&43404, PPlanner!$D:$D, "<"&43435)
This is going to look at sheet PPlanner column X and count how many instances of 1367 occur after the last day of October and before the first day of December. There are other ways to accomplish this, but it allows you to count within any date range you want.

filter data between 2 dates in excel using VBA

i was wondering if someone can help. i have tried some formulas but cant seem to work this out. i have a list of data with lots of dates some duplicate dates which are fine. i have data on a daily basis from 2015-2018. my aim is to try to put a number against each week between 2 dates so Monday-Sunday representing a week. so if the date falls between to dates bring back the week number. but of course there is a long list of date ranges and week ranges. does anyone know a formula or code to read to date and look between 2 separate dates and bring back a week number
thanks
Muj
For a given date, weeknum() will return the week number:

Excel: Trying to count cells based on date, can't figure out SumIf

hopefully you can help me with this. I've been trying to figure it out in Excel myself, but I can't make the functions work and it's causing me to manually count the cells.
I've created a sample sheet on Google to show roughly what I'm trying to do;
https://docs.google.com/spreadsheets/d/18bFBvtbK-3JDj6Z6_b6NHttaytApNvdfw92ZcI4ECws/edit#gid=0
I have a series of tests my personnel have to take annually, and I want to write a function that displays the total number of tests taken within the past year. Cell B1 would be the column title, B2-4 would display the date the test was taken, and B5 is where I want the number of dates in B2-B4 that are less than one year old.
Any ideas?
If you want less than a year old from todays date then just count all values that are greater than 365 days ago,
=COUNTIF(B2:B4, ">"&(TODAY()-365))

Need to figure out an average of cells based on 22 days prior to today

I have an all-encompassing spreadsheet in Google that I need to total up based on a date. I need to figure out the daily usage of items going out based on the date. So.. I have a column (A) with dates. Each cell =today(). I have a column with outgoing items (I). I need to average items in column I based on the last 22 days. Any help?
I also need to figure out weekly and monthly totals, but that can be another topic.
=AVERAGEIF($A:$A,">"&TODAY()-22,I:I)

Resources