Return value that most often occurs adjacent to another value

sanchovonbadgerson

New Member
Joined
Nov 13, 2017
Messages
5
I need a little help please,

I have a large list of employees, each month they make mistakes in processing I have a report generated monthly which contains columns relating to their names and the types of error they have made - where each person may have made multiple errors of varying types

ideally I want to have a second tab which wil automatically pull through the names in ranking order of errors made in the dataset, they return the total number of errors, the type of most common error and the count of that type.
I appreciate that a pivot table could resolve most of this, but due to the volume of data each month and the eventual person who will have to compile the data in to a report this would be overly time consuming.


all help is greatly appreciated. Due to the system used at work - VBA is out, I need a formula based solution

thus far I can return a list of names in order of occurences by adding a check column to the source data with this:

=IF(F2="","",IF(COUNTIF(F$2:F2,F2)=COUNTIF($F$2:$F$9999,F2),COUNTIF($F$2:$F$9999,F2)+(ROW()/1000),""))

then on a results page this:

=IF(ROWS($1:1)>COUNT(Worksheet!A:A),"",INDEX(Worksheet!F:F,MATCH(LARGE(Worksheet!A:A,ROWS($1:1)),Worksheet!A:A,0)))

extracting the total number of errors relatively simple then with this

=IF(B3="","",COUNTIFS(Worksheet!F:F,B3,Worksheet!J:J,"Error made"))

but i then require the modal error from the list - and im struggling

a sample of the source data


ReferenceTeamCategoryError ByError By NameLogged ByDepartmentErrorStatusDate ReportedDate error Made
4169321CSProcedure ErrorKW5Kieran Wilkinsoncd7AuditingHold time too longError Made31/10/201730/10/2017
3621797CSProcedure ErrorAA4Ashley Allsoppcd7AuditingCard DPAError Made31/10/201730/10/2017
254413CSProcedure ErrorAA4Ashley Allsoppcd7AuditingCard DPAError Made31/10/201730/10/2017
4392925CSDiariesKY2Keeley Sweeneycd7AuditingNot added diary when should haveError Made31/10/201730/10/2017

<tbody>
</tbody>



I appreciate this is me basically asking someone to do a job for me, I can usually figure most things out but I am entirely self-taught and this one has me stumped.

Cheers in advance
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Re: Return value that most often occurs adjacent to antoher value

slight update - ive been working with this formula, but the result is then simply the bottom value in the adjacent cell as opposed to the most frequently occuring

=IFERROR(LOOKUP(1E+100,SEARCH(B3,Worksheet!F:F),Worksheet!I:I),"")

where B3 is the name produced as a result of this:

=IF(ROWS($1:1)>COUNT(Worksheet!A:A),"",INDEX(Worksheet!F:F,MATCH(LARGE(Worksheet!A:A,ROWS($1:1)),Worksheet!A:A,0)))
 
Upvote 0
Re: Return value that most often occurs adjacent to antoher value

antoher update - i think ive cracked it, based on the below - with varitations depending on desired outcome

=INDEX(Worksheet!I:I,MODE(IF(Worksheet!F:F=Sheet1!B3,IF(Worksheet!I:I<>"",MATCH(Worksheet!I:I,Worksheet!I:I,{0,0})))))

only problem is im running this in four columns will multiple variables over around 200 rows, so the sheet is running painfully slow.
that said the person who asked me of it was rpeviously using pivot tabels and it took about two hours every month to compile the data - this way, copy paste and then wait 10 mins, i'll update if I find a better solution
 
Upvote 0
Does it need to be that complicated?


M​
N​
O​
P​
1​
Error By
Procedure Error​
Diaries​
2​
KW5
1​
0​
N2: =COUNTIFS($D$2:$D$5, $M2, $C$2:$C$5, N$1)
3​
AA4
2​
0​
4​
KY2
0​
1​
 
Upvote 0
I appreciate what you are saying - but there are just north of 600 staff, with relatively high turnover due to the nature of the business (so i cant fix the columns and do a simple count of users- life would be easier that way), there are also approximately 200 different types of 'error', about 20 catagories with about 10 types in each catagory. The above selection isnt great as it doesnt really represent the data.
As an example, in October, the worst ofending staff member made 71 errors, 30 of which fell into the same type, position 50 made 20 errors - 10 of the same type.
total lines of data to look at for the month are a couple of thousand

we are looking for who they are, where they work, total errors, count of most frequently occuring error, what that error is & what department logged the most frequently occuring error against them

To be fair the above is taking about 3 mins to fully calculate - the lady who usually gets the report together spends about 2 hours each month with pivot tables sorting out - net saving 1hr 57 mins.

I would bet heavily it can be done in a much more elegant way than I have found, but without all of the source data and output information It would be difficult to explain fully - and unfortunately some of the information contained in the source is sensitive.
 
Upvote 0
It seems to me that the report would be as complicated to absorb as the raw data.

I would think the objective would be to learn what the most prevalent types of errors are (perhaps cost-weighted, with a thought to how they could be reduced over time), and who is the most error-prone (with a thought as to retraining or whacking them).

Changing a sea of data to another sea of data wouldn't seem to me like it would help.
 
Upvote 0
This is one of those "ours is not to reason why" moments, I was asked if I could save a friend (an assistant to a higher up) some time in collating the data. IT department said it couldnt be done, and at first glance so did the internet. Anyway - she's chuffed with what i have done so far. I'll keep an eye out for better solutions. Basically the people who appear in the top 50 on this report are in for some bother.

Cheers for attention though.
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top