FCR Calculation for Number of calls vs Y / N responses - excel-formula

I'm currently looking at a way to calculate FCR data.
The goal is for the formula to look at what name is in column A, and then to see how many calls are made in B that either match Y or N and then the calculate it as an average in column F.
I've put a mock up of what the data looks like when entered and also in E and F where i'd like the actual outcome to be presented.
I've been trying to work with a Sumif/Countif this morning and have not been able to get it off the ground, any support would be great and i can also then use it for future learning.
do you guys think this is possible?
enter image description here

With Office365 you could use the following in E2:
=UNIQUE(A2:A9)
This spills the unique names.
In F2 you can than use a SUMIFS referencing the data and the spill:
=SUMIFS(B2:B9,C2:C9,"Y",A2:A9,E2#)/SUMIFS(B2:B9,A2:A9,E2#)
(Format these as percentage)

Related

Nearest set of coordinates but excluding current coordinates and blanks from dataset

My question builds off of the one asked here and the accepted answer:
Find the nearest set of coordinates in Excel
The accepted answer there provides two solutions:
Non-circular distance:
=LOOKUP(1,1/FREQUENCY(0,MMULT((B$1:C$10-E1:F1)^2,{1;1})),A$1:A$10)
Circular distance:
=LOOKUP(1,1/FREQUENCY(0,SIN((RADIANS(B$1:B$10-E1))/2)^2+SIN((RADIANS(C$1:C$10-F1))/2)^2*COS(RADIANS(B$1:B$10))*COS(RADIANS(E1))),A$1:A$10)
However, that dataset looks like this:
I'm trying to work with a dataset that looks like the following:
What I'm trying to do is:
Fill in G and H where they are empty.
If G and H is empty, look at E and F (e.g. G2 and H2 are empty, so get the coordinates from E2 and F2).
Search all E and F for the next closest coordinates where G and H are not blank.
Return the value of G and H.
All I have so far is modifying the Non-circular solution:
=LOOKUP(1,1/FREQUENCY(0,MMULT(($E$2:$F$69778-E2:F2)^2,{1;1})),$H$2:$H$69778)
Of course with this, it just matches to itself and G and H are blank so it returns nothing.
Any suggestions for how to implement this?
As a last resort I can always just copy to a separate tab all of the rows with values in G and H and do the lookup against that. Trying to implement it without doing that first however.
The original formula is a bit hard to understand but uses the behaviour of Frequency and Lookup in a very efficient way. It avoids the need to re-calculate the differences and their squares which would be needed if you used the more obvious method of finding the minimum squared difference and looking it up in a list of the squared differences.
Short answer - you could easily tweak the non-circular formula by adding a large number to the non-blank rows:
=LOOKUP(1,1/FREQUENCY(0,MMULT((B$1:C$10-E1:F1+999*(D$1:D$10<>""))^2,{1;1})),A$1:A$10)
This gives E where the original formula would have given D.
The same with the circular formula, I think I'm right in saying that the value of this version of the haversine formula can never exceed 1, so try:
=LOOKUP(1,1/FREQUENCY(0,SIN((RADIANS(B$1:B$10-E1))/2)^2+SIN((RADIANS(C$1:C$10-F1))/2)^2*COS(RADIANS(B$1:B$10))*COS(RADIANS(E1))+10*(D1:D10<>"")),A$1:A$10)
Notes
If I were doing this now and starting from scratch, I would probably use Let and Xlookup in Excel 365 to make it easier to read.
As has been mentioned in a comment, there should be a latitude correction to the first formula to make it approximately correct over short distances.

Use If flexibly to get average

I want to calculate the response time across multiple subjects with one restriction: only response time from the correct trials should be included in the average. The structure of my data looks like below (for simplicity, I show only 3 subjects and 10 trials, in reality, I have many more)
I would like to get average of RT across subj1, subj2, and subj2 for each of the trials. Only correct trials are included in the average. 0 and 1 are used to denote incorrect and correct trials, respectively. For instance, for cell G2, I would only include B2 and D2 in the average, F2 is left out since the ACC for that trial from that subject is 0. I imagined using If AND function to include the appropriate RT but with many subjects, this becomes very clumsy. Does anyone have a clever solution to this?
Since 0 * anything = 0, G2 = SUM(A2*B2,C2*D2,E2*F2)/SUM(A2,C2,E2)
You can do this with AVERAGE and an array formula which can be easily extended to larger ranges, i.e.
=AVERAGE(IF((RIGHT(B$1:F$1,2)="RT")*(A2:E2=1),B2:F2)
confirm with CTRL+SHIFT+ENTER
...or even simpler with AVERAGEIFS like this
=AVERAGEIFS(B2:F2,A2:E2,1,B$1:F$1,"*RT")
note the “offset” ranges

AverageIf and Multiple data strings

I'm involved with a youth football tournament on the referee side, with assessing/coaching the referees. I've just taken over doing the data entry for the referees assessment scores which we then use to determine who gets finals etc and am looking to extract more usable information from the data to help us identify trends.
I've got (up to) 200 referees, each receiving from none to two assessment scores each day for 5 days. The scores are entered as both the raw mark and the weighted mark based on match difficulty (along with a host of other data about the match that isn't relevant to this issue.
I can extract the average mark (raw and weighted) across all referees without issues and have done so using the below formula, which is the raw average mark:
=AVERAGE(Working!AK4:AK200,Working!BK4:BK200,Working!CL4:CL200,Working!DL4:DL200,Working!EM4:EM200,Working!FM4:FM200,Working!GN4:GN200,Working!HN4:HN200,Working!IO4:IO200,Working!JO4:JO200)
But I also want to extract the average mark (raw and weighted) across two subsets - Academy and non academy referees, to help plot trends and determine where resources need to be utilised.
I've attempted to use an AVERAGEIF formula, but am getting a #VALUE! return. This is the formula that I've attempted to use to return the average raw mark for those referees in the academy:
=AVERAGEIF(Working!G4:G200,Working!G4:G200="Yes",(Working!AK4:AK200,Working!BK4:BK200,Working!CL4:CL200,Working!DL4:DL200,Working!EM4:EM200,Working!FM4:FM200,Working!GN4:GN200,Working!HN4:HN200,Working!IO4:IO200,Working!JO4:JO200))
If I do the same formula as above, but without the brackets around the [average_range], I get a 'you've used too many arguments, and it highlights BK200.
From what I've been able to find so far online, it seems that the formula I'm trying to use would only work if ALL the cells in (Working!G4:G200) returned "Yes". However if there are only 50 academy referees as indicated by "Yes" in G column, then I want those specific scores to be averaged, and the inverse for the non-academy referees.
I thought about having another sheet, which would simply contain populate from Column G (a simple =G4 and then populated down to =G200 next to all of the scores), consolidated into a block of raw marks columned under Assessment 1, 2, 3, 4.... and then the same for all of the weighted marks which would populate from the equivalent cell on the working sheet, but there's a lot of filtering, and re-sorting that goes on on the working sheet, and I'm not 100% certain that that wouldn't cause issues.
Any feedback on how to work through this problem, so that I can display the overall average mark for academy and non-academy referees in both raw and weighted form would be much appreciated, and I apologize if this post is rather convoluted.
I don't think there is a neat solution if the scores are in several columns which are not consecutive.
My suggestion is:-
(1) Work out the sum for each column separately and total them up
(2) Work out the count for each column separately and total them up
(3) Divide Sum by Count to get Average.
In my small example below with 3 referees and 3 columns:-
(1) In K2:-
=SUMIF(H2:H4,"Yes",B2:B4)+SUMIF(H2:H4,"Yes",D2:D4)+SUMIF(H2:H4,"Yes",F2:F4)
(2) In K3:-
=COUNTIFS(B2:B4,">=0",H2:H4,"Yes")+COUNTIFS(D2:D4,">=0",H2:H4,"Yes")+COUNTIFS(F2:F4,">=0",H2:H4,"Yes")
(3) In K4:
=K2/K3
This would include any zero scores (if this is possible) but exclude any blanks.
You can then scale it up to your data.
Beyond this, you would have to change the data structure either
(1) Add a row to label the columns that you want to average e.g.
Score 1 Score 2 Score 3
3 0 3
so you could pick up only the columns labelled 3 say
Here's how it would be in my small example:-
In K3:-
=SUM((B$2:F$2=3)*($H3:$H5="Yes")*B3:F5)
Which is an array formula and must be entered with Ctrl-Shift-Enter
In K4:-
=SUM((B$2:F$2=3)*($H3:$H5="Yes")*(B3:F5<>""))
another array formula
In K5:-
=K3/K4
This is how the columns you want are labelled with a 3 in row 2, so it ignores the other columns:-
(2) Consolidate them into another sheet as you suggest.

Finding 'x' in Excel

I have a problem I need help with, please.
I want to find x in the following manner:
((a+x)/(b+x))>=c
This would be an extension to a simple calculation in my workplace, d=a/b where:
b is the total number of incoming calls we receive
a is the number of calls we could handle out of b, the total
d shows our performance
So far so good. No function needed.
But we also have a target, c, in percentage - let's say 60% or 0.6
Ideally a/b should be bigger than c.
IF it is not, I'd like to know how many more incoming calls we need that are also handled (with x added to both a and b above) therefore slowly raising our performance over time.
x would show this extra number of handled calls, say, "5"
I do not know what type of mathematics it is (I cannot recall it, shame on me)
I do not know how to achieve it in Excel
Can someone please help? thank you!
((a+x)/(b+x))>=c
then
a+x >= c(b+x)
then
a+x >= cb+cx
then
a-cb >= cx-x
then
a-cb >= (c-1)x
then
(a-cb)/(c-1) >= x
So if you have values for a,b,c then the range for x is defined.
When you cannot solve the equation "analytically", you might use the "goal seek".
Use a param in any range, such as "A1". Fill it with any value looking like your answer (if you want a percentage put 50%, etc.).
A1=3
B1=((a+A1)/(b+A1))
Open "Data" tab and "What-If analysis" and "Goal Seek".
In "Set Cell", select "B1"
In "To Value", set the value you want to reach (0.6 in your sample)
In "By changing cell", set A1.
Click OK, see A1 becoming the expected result.
This might be a case for a graphical presentation:
where the formula in F2 (copied down) is =IF(E2>0,E2,0) and a Stacked Column has been applied.

Interpolating data points in Excel

I'm sure this is the kind of problem other have solved many times before.
A group of people are going to do measurements (Home energy usage to be exact).
All of them will do that at different times and in different intervals.
So what I'll get from each person is a set of {date, value} pairs where there are dates missing in the set.
What I need is a complete set of {date, value} pairs where for each date withing the range a value is known (either measured or calculated).
I expect that a simple linear interpolation would suffice for this project.
If I assume that it must be done in Excel.
What is the best way to interpolate in such a dataset (so I have a value for every day) ?
Thanks.
NOTE: When these datasets are complete I'll determine the slope (i.e. usage per day) and from that we can start doing home-to-home comparisons.
ADDITIONAL INFO After first few suggestions:
I do not want to manually figure out where the holes are in my measurement set (too many incomplete measurement sets!!).
I'm looking for something (existing) automatic to do that for me.
So if my input is
{2009-06-01, 10}
{2009-06-03, 20}
{2009-06-06, 110}
Then I expect to automatically get
{2009-06-01, 10}
{2009-06-02, 15}
{2009-06-03, 20}
{2009-06-04, 50}
{2009-06-05, 80}
{2009-06-06, 110}
Yes, I can write software that does this. I am just hoping that someone already has a "ready to run" software (Excel) feature for this (rather generic) problem.
I came across this and was reluctant to use an add-in because it makes it tough to share the sheet with people who don't have the add-in installed.
My officemate designed a clean formula that is relatively compact (at the expensive of using a bit of magic).
Things to note:
The formula works by:
using the MATCH function to find the row in the inputs range just before the value being searched for (e.g. 3 is the value just before 3.5)
using OFFSETs to select the square of that line and the next (in light purple)
using FORECAST to build a linear interpolation using just those two points, and getting the result
This formula cannot do extrapolations; make sure that your search value is between the endpoints (I do this in the example below by having extreme values).
Not sure if this is too complicated for folks; but it had the benefit of being very portable (and simpler than many alternate solutions).
If you want to copy-paste the formula, it is:
=FORECAST(F3,OFFSET(inputs,MATCH(F3,inputs)-1,1,2,1),OFFSET(inputs,MATCH(F3,inputs)-1,0,2,1
(inputs being a named range)
There are two functions, LINEST and TREND, that you can try to see which gives you the better results. They both take sets of known Xs and Ys along with a new X value, and calculate a new Y value. The difference is that LINEST does a simple linear regression, while TREND will first try to find a curve that fits your data before doing the regression.
The easiest way to do it probably is as follows:
Download Excel add-on here: XlXtrFun™ Extra Functions for Microsoft Excel
Use function intepolate().
=Interpolate($A$1:$A$3,$B$1:$B$3,D1,FALSE,FALSE)
Columns A and B should contain your input, and column G should contain all your date values. Formula goes into the column E.
A nice graphical way to see how well your interpolated results fit:
Take your date,value pairs and graph them using the XY chart in Excel (not the Line chart). Right-click on the resulting line on the graph and click 'Add trendline'. There are lots of different options to choose which type of curve fitting is used. Then you can go to the properties of the newly created trendline and display the equation and the R-squared value.
Make sure that when you format the trendline Equation label, you set the numerical format to have a high degree of precision, so that all of the significant digits of the equation constants are displayed.
The answer above by YGA doesn't handle end of range cases where the desired X value is the same as the reference range's X value. Using the example given by YGA, the excel formula would return #DIV/0! error if an interpolated value at 9999 was asked for. This is obviously part of the reason why YGA added the extreme endpoints of 9999 and -9999 to the input data range, and then assumes that all forecasted values are between these two numbers. If such padding is undesired or not possible, another way to avoid a #DIV/0! error is to check for an exact input value match using the following formula:
=IF(ISNA(MATCH(F3,inputs,0)),FORECAST(F3,OFFSET(inputs,MATCH(F3,inputs)-1,1,2,1),OFFSET(inputs,MATCH(F3,inputs)-1,0,2,1)),OFFSET(inputs,MATCH(F3,inputs)-1,1,1,1))
where F3 is the value where interpolated results are wanted.
Note: I would have just added this as a comment to the original YGA post, but I don't have enough reputation points yet.
alternatively.
=INDEX(yVals,MATCH(J7,xVals,1))+(J7-MATCH(J7,xVals,1))*(INDEX(yVals,MATCH(J7,xVals,1)+1)-INDEX(yVals,MATCH(J7,xVals,1)))/(INDEX(xVals,MATCH(J7,xVals,1)+1)-MATCH(J7,xVals,1))
where j7 is the x value.
xvals is range of x values
yvals is range of y values
easier to put this into code.
You can find out which formula fits best your data, using Excel's "trend line" feature. Using that formula, you can calculate y for any x
Create linear scatter (XY) for it (Insert => Scatter);
Create Polynominal or Moving Average trend line, check "Display Equation on
chart" (right-click on series => Add Trend Line);
Copy the equation into cell and replace x's with your desired x value
On screenshot below A12:A16 holds x's, B12:B16 holds y's, and C12 contains formula that calculates y for any x.
I first posted an answer here, but later found this question

Resources