Formula or function for getting salesperson monthly sales average - excel

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.

Related

In Tableau can I calculate a column based on totals of two other columns?

I'm new to Tableau and new to posting in Stackoverflow so bear with me.
I have a dataset with variables such as State, County, Organization, 2020 Enrollment, 2021 Enrollment, and Delta (change in enrollment over those two years). What I want is a column that gives the percent delta in enrollment over these two years.
The first thing I tried was calculating a column just using the growth formula:
(ZN([2021Enrolled])-ZN([2020Enrolled]))/ZN([2020Enrolled])
In the Data View this works great, because nothing is being summed, I get the correct delta. But when I use this formula in my worksheet, what happens is that the formula is being calculated across all the observations (there are several observations per county, per organization, for example) and then summed up. This gives an incorrect delta for year over year.
What I am looking for is a way to calculate the % delta column based on the total enrollments for 2020 and 2021 in order to achieve the correct % delta.
I included two screenshots below showing what Tableau is giving, and then an Excel spreadsheet of the same data filtered on just one county to show the problem a little better.
Maybe a similar question has been asked before, but I was unsure just how to search this up. Any help would be appreciated.
Thanks!
Sam
Tableau view
Excel view
I found the answer: I was trying to create a calculated column in Data View, what I needed to do was create a calculated column in my worksheet view, so that it would only work on the data presented there.

Is there a way to sum data in Excel by group/category?

I'm completely new to Excel and am actually using it for the first time for a math paper, so I'm pretty lost to start with.
I have a large spreadsheet of data. It's organized in a table with the headers: country code, country name, date, and total. The dates range from April, 2020 to March, 2021 for 203 countries.
What I'm trying to do is to take the total amounts from each country each day.
I've included some screenshots from my excel spreadsheet:
Adding this data isn't so bad, right now I'm using the function =SUMIF(range, criteria (I'm just using ">0")). But when I have so much data to add, this feels really inefficient.
I was wondering if there was a function or if I could somehow create a function, that would let me input a country code and it would sum every row that has that country code? Or something similar that would speed up the process?
I'm sorry if this isn't the best-formatted question, it's my first time asking anything on Stack Overflow and I still new to the expectations from the community. Please let me know any extra information I can provide, ways I can clarify, or anything else.
Thank you to everyone in advance!
Depending on what you want to look at you can either use SUMIF / SUMIFS or a PIVOT table.
For your example above, I would recommend a PIVOT table. You can find further information on PIVOT tables here. Simply drag and drop the values you want to have in each row / column into the respective fields.
In case you then want the result to look nice, you can find information on formatting PIVOT tables here

Calculate average based on a value column (count) in a pivot table

I'm looking a way to add an extra column in a pivot table that that averages the sum of the count for the months ("Count of records" column) within a time period that is selected (currently 2016 - one month, 2017 - full year, 2018 - 5 month). Every month would have the same number based on the year average, needs to be dynamically changing when selecting different period: full year or for example 4 months. I need the column within the pivot table, so it could be used for a future pivot chart.
I can't simply use average as all my records appear only once and I use Count to aggregate those numbers ("Count of records" column).
My current data looks like this:
The final result should look like this:
I assume that it somehow can be done with the help of "calculated filed" option but I couldn't make it work now.
Greatly appreciate any help!
Using the DataModel (built in to Excel 2013 and later) you can write really cool formulas inside PivotTables called Measures that can do this kind of thing. Take the example below:
As you can see, the Cust Count & Average field gives a count of transactions by month but also gives the average of those monthly readings for the subtotal lines (i.e. the 2017 Total and 2018 Total lines) using the below DAX formula:
=AVERAGEX(SUMMARIZE(Table1,[Customer (Month)],"x",COUNTA(Table1[Customer])),[x])
That just says "Summarize this table by count of the customer field by month, call the resulting summarization field 'x', and then give me the average of that field x".
Because DAX measures are executed within the context of the PivotTable, you get the count that you want for months, and you get the average that you want for the yearly subtotals.
Hard to explain, but demonstrates that DAX can certainly do this for you.
See my answer at the following link for an example of how to add data to the DataModel and how to subsequently write measures:
Using the Excel SMALL function with filtering criteria AND ignoring zeros
I also recommend grabbing yourself a book called Supercharge Excel when you learn to write DAX by Matt Allington, and perhaps even taking his awesome online course, because it covers this kind of thing very well, and will save you significant head-scratching compared to going it alone.

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 :)

Formula for getting worksheet names based on pivot table results

I have an excel file with 30 time cards, each on their own worksheet, where the only identifier is the worksheet name (ie the employee name). Each worksheet has a first column of account numbers, followed by columns for hours worked for each day of the month, and then total.
From these individual employee tabs I make a Totals worksheet(using =SUM('Adams:White'!B1) and then fill left and fill down. . .)
I then make a pivot on the Totals data and get summary data for the department. (ie we spent 100 hours total on account# 12345) - no problem.
My Question is: How do I write a formula(s) to find which employees contributed to the hours spent on account# 12345. The specific output I would want is a table with a column heading of "12345", and then only the names of those who worked on that account below the heading. (Or all names, sorted, with a second column of how many hours they worked on "12345").
Thanks!
Steve
Since you are feeding your data set into a pivot table, you will need to ensure each record (row) in your data set is reportable. i.e. if Adam and Jane worked on account 12345 for a total of 7 hours and your record in your data set (table) is only one row with the account listed and the total number of hours, it will be difficult and extremely bad practice to attempt to report this by staffer (how do you know that the 7 hours is made up of Adam and Jane, or it could be 14 part-time workers that each put in half an hour).
You have two approaches. One: you could consolidate the data into a master data tab and from there you could have each sheet (Adam, Jane, White) be a report off the master table to show performance by staffer.
Two: Make use of power pivot, if you have Excel 2013+ installed. Here you would create a link for each table by account. Now you would have each rep's hours contributed as a field in the power pivot connection.
Please let me know which of the two seems a better choice and I can assist from there.

Resources