Excel Retention Calculation - excel

Excel Masters,
I have an Excel worksheet with a list of employees (ColumnA), dates (ColumnB), and Customers(ColumnC). I want to calculate the employees retention rate based on the customers that visited.
If a customer visited an employee and came back the next month and visited the same employee, they are considered retained for that employee.
If a customer visited an employee and came back the next month and visited a different employee, they are considered retained.
If a customer visited in one month, but didn’t come back the next month, they are considered lost.
Employee Date Customer
Zach 11/2/19 Tyler
Zach 11/20/19 Tyler
Zach 10/2/19 Tiffany
Zach 10/3/19 Tiffany
George 11/1/19 Tiffany
George 11/9/19 Tyler
George 10/2/19 Mike
George 10/30/19 Michael
I want to see a % retention for each employee across all months that are in the data.
At the moment, I've tried using a combination of COUNTIFS to find the solution but with no luck.

I can offer an in-place calculation, but it can also be converted to a separate report.
Formula for 'Retained' calculation:
=--(SUMPRODUCT(--(C2=$C$2:$C$11);(--(MONTH(B2)+1=MONTH($B$2:$B$11)))+(--(MONTH(B2)-1=MONTH($B$2:$B$11))))>0)
Array formula for 'Retention %' calculation (for employee across all clients):
{=SUM(IF(A2=$A$2:$A$11; IFERROR(1/(COUNTIFS($A$2:$A$11; A2; $C$2:$C$11; $C$2:$C$11;$D$2:$D$11;1));0); 0))/SUMPRODUCT(1/COUNTIF($C$2:$C$11;$C$2:$C$11))}
Edit:
Just add example with an percentage report in a separate table. Same formula, just moved to new area:
{=SUM(IF(G2=$A$2:$A$11; IFERROR(1/(COUNTIFS($A$2:$A$11; G2; $C$2:$C$11; $C$2:$C$11;$D$2:$D$11;1));0); 0))/SUMPRODUCT(1/COUNTIF($C$2:$C$11;$C$2:$C$11))}

Related

Formula or function for getting salesperson monthly sales average

Salesperson
JANUARY
FEBRUARY
SALES TYPE 1
'=January Ave
'=February Ave
SALES TYPE 2
'=January Ave
'=February Ave
I need help figuring out what formulas/nested functions I would use in the January and February average columns in the above table. The Excel document I'm working with has a tab for each sales person. In these tabs include the above table-like scorecard element.
I'm using the old "Sharing" feature of Excel which has a lot of limitations, you can't have tables in the document for example (experts, correct me if I am wrong about this) this is why I'm hoping to use a formula to get, calculate and input the data where it needs to go.
There is another tab where all the data is stored in a table-like structure. It has columns for the date of the sale, the ID of the sales person and how many sales were made on that day.
I'm also worried that too complicated of a formula being done 24 times in each sheet and there being a total of 50 sheets in the document, would this cause the document to lag? I'm reading on index match vs xlookup, I hear sumifs is easy but the file doesn't work as fast with that?
What formulas would you use? Any advice how to make sure the document runs smoothly when users use it? Any advice here is welcome. Thanks in advance for you patience.

How can I determine how much time a customer has spent speaking to multiple agents

I have a spreadsheet in which each records the amount of time a customer spent on the phone with an agent, I want to write a formula that averages the total time spent by a user per agent.
Customer Agent Time spent (MM:SS)
John Smith Sally Jenkins 1:15
John Smith Sally Jenkins 2:07
John Smith Adam Apple 3:55
John Smith Adam Apple 1:42
For example, how can I determine the average time John Smith Sent with Sally Jenkins, output that, and then separately determine the average time John Smith spent with Adam apple?
Is that even possible? Any help would appreciated. Thank you!
The simplest way is probably to use a Pivot Table. Insert a Pivot Table based on your data, then put Agent in the Rows, and Average of Time Spent in the values.
You can also use SumIfs()/CountIfs to get an average over a large dataset given specific criteria without needing to manually select the cells with the times to average. With this, you can select the entire data range and the formula will figure out which cells to include in the average based on the criteria you specify.
=SUMIFS($C$2:$C$5,$A$2:$A$5,F2,$B$2:$B$5,G2)/COUNTIFS($A$2:$A$5,F2,$B$2:$B$5,G2)
I don't know of anything simpler than AVERAGEIF/AVERAGEIFS.
In G2 per image (and filled down),
=AVERAGEIFS(C:C, A:A, E2, B:B, F2)
In G6 per image,
=AVERAGEIFS(C:C, A:A, E6)
If your cells are formatted properly, you can just use =AVERAGE():

Sum product for all the months if 2 tables match

So I have this issue, I have two tables one is employees, and another one is the projects.
Employees Table:
Year Name Type Jan Feb
2018 Kevin Salary 5000 2000
2018 Kevin Insurance 200 400
2018 Alex Salary 3000 4000
2018 Alex Insurance 300 400
Projects Table
Year Project_Name Employee_Name Jan_Hours_Worked Feb_Hours_Worked
2018 Apple Alex 7 5
2018 Apple Kevin 5 0
2018 LG Kevin 0 3
Now I am creating a result list of all the projects and costs recurred for them, what I need is for each project in Table 2 to find which employees are involved and then use that to find related costs for the employee from the Table 1 and calculate total costs for that project.
(e.g for project LG, I have Kevin working on that in Feb,for him company paid 4400(salary+insurance) in Feb and the costs recurred for the LG project would be 4400 divided by hours spent on the project which Kevin in total spent 3 hours; e.g.2 for the project Apple it would be the same but sum of Kevin's and Alex's costs from Jan and Feb, so Kevin: 5200/5 + Alex:3300/7 + 4400/5)
Now I have the formula to calculate this for 1 months which is something like this
=SUMPRODUCT(SUMIFS(Employees[Jan], Employees[Name],Project[Employee_Name], Employees[Year], 2018 )/Project[Jan_Hours_Worked],--(Project[Project_Name]=K14))
I need to find how to get the yearly result per project without repeating the formula 12 times, also with this formula, i get div to 0 error when an employee didn't work on particular months, so that needs to be sorted somehow. Any Help?
I suggest you to change how you store your data. If you can make some minor changes, then you can have an easy way to get the information you want, and also a Pivot Table with a summary of cost recurred for each proyect and which employee generated that cost.
IMPORTANT: For this answer to work, you must make sure that every Employee's Name is UNIQUE. If not, adapt the example trying to create
an Employee's ID or something.
Also, please, note i got a spanish version of Excel, so screenshots are in spanish but I will translate formulas :)
Ok, first of all, I changed the design of your table Employees. Creating a column for each month is kind of annoying. Use just a column to get the month. You can type the month in a cell just like 01/2018 and Excel will change it instantly to format mmm-yy (Jan-18)
This is how your Employees table should look:
The column TOTAL COST is just a sum of SALARY + INSURANCE. If you have any other concept, just add it as a column and modify the TOTAL COST COLUMN to include it.
Second, the table Project, I think it should be like this:
The column Employee Cost has an Array Formula.
IMPORTANT: Array formulas are inserted pressing CTRL+SHIFT+ENTER
The formula is (I used same names for tables, so copy-pasting should work for you):
=INDEX(Employees;MATCH(Project[[#This row];[Employee_Name]]&Project[[#This row];[Month]];Employees[Name]&Employees[Month];0);COLUMN(Employees[[#Headers];[TOTAL COST]]))
If you typed the formula right, you should see { at start and } at end.
The formula in Cost Recurred to Project is just a division of Employee Cost / Hours. Added an IFERROR when the hours worked are 0, then show 0.
=IFERROR(Project[[#This row];[Employee Cost]]/Project[[#This row];[Hours]];0)
And last step, your Pivot Table. Create one and organise it to get the sum per hours and month and proyect you want. You can get one like the one below:
As you can see,e.g. for project Apple, you can see that total cost is 2.391,43
but also you can see the cost of each Employee. Pretty cool I think.
I really hope you can modify the design of your data, because Excel is designed to work going down (I mean using rows) more than using columns. Excel 2007 got more than 1 million of rows and just around 16.000 columns, so it's designed to work vertically.
Hope this helps, or at least, give to you a clue of how to proceed :)

Count Unique Entries in a Month for Pivot Table

Good afternoon,
I'm currently working on setting up a pivot table for chart that outlines an Average Revenue per Person by Line Type. Using the pivot table, I can sort everything out, but when I try to get a count of person, it adds all instances of that person's name up. What I want is that if the person's name appears once in a month, all other instances in that month of the person's name are not counted. But during a new month, the person's name will appear once more. So, it is somewhat like a unique count, but only unique per month.
My excel table looks something like:
A B C D
Date Person Revenue Line Type
1/1/2015 John $100 Toy
1/6/2015 Phil $200 Toy
1/6/2015 Jane $25 Garden
1/7/2015 John $50 Electronics
1/25/2015 John $10 Electronics
2/1/2015 John $10 Toy
2/17/2015 Phil $30 Garden
2/20/2015 Bob $500 Electronics
2/21/2015 Jane $100 Garden
So, as you can see, a person's name can occur more than one time in a month, and in more than one month. Currently, the code I am using for my helper column (E) is:
=1/COUNTIF($B:$B,B2)
This has only been giving me a count of patients throughout the entire year, not taking new months into account. I also have attempted this formula:
=IF(SUMPRODUCT(($B$2:$B2=B2)*($A$2:$A2=A2))>1,0,1
This only counts values that occur on the same day. I've tried adding in MONTH() checks and such, and am only getting syntax errors. I'm not sure where to turn for this one. Thank you!
Thanks to #TomSharpe's advice, I added a helper column to concatenate Month/Date and the Patient's name like so:
=MONTH(A2)&"-"&B2
Then used the original formula (below) to COUNTIF divided by 1.
=1/COUNTIF($B:$B,B2)
This gave me exactly what I needed.
Thanks again!

Statistics from workbook

I have a mutable sheet workbook. I have several people entering their work into it. I need to pull statistics from entries by date and assigned to a person by name. I have pulled information by date but need to further break it down by assigned person’s name. Any help?
Order number Order Date Filled Date Shipped Date sales Person
2013-001 1/23/2013 1/23/2013 1/26/2013 Bill
2013-002 2/12/2013 2/13/2013 2/15/2013 Bill
2013-003 3/12/2013 3/12/2013 3/14/2013 Tom
2013-004 4/12/2013 4/13/2013 4/20/2013 Tim
I suggest a PivotTable, maybe something like this:
but you have option on which date or dates to choose and how to organise the layout.

Resources