Summing up cohort behavior cumulatively by date ranges without offsets in excel - excel

I think this problem, when solved by creating additional charts with offsets, is easy. I want to cut out the middle man and not use offsets (unless they are useful to the answer). I have data for daily cohorts and I know specific information about their behavior 1 day later, 2 days, 3 days ect.
Now it is rather easy to make a waterfall chart of day by day activity like so...
What I want to do is skip this step (directly above, the waterfall chart) in hopes of shrinking my current workbook by a substantial amount. You can imagine having simply 1 year of data across multiple channels measuring even 1 aspect of behaviors can account for a lot of data and pivot charts. Also, btw, I have the top chart as a pivot thus allowing this to be hands off when calculating what I am looking for.
What I seek - I look to further construct groups of days as other cohorts to examine (for example, say, 1/1 - 1/5) and see what their activity has been in a cumulative fashion since then. To be more specific, I want a table that will show cohort 1/1-1/5's activity in the date range 1/1-1/5 (11) and then their activity from 1/1-1/9 (24, an additional 13 "behavior points" summed).
So far, as I said, my current solution involves the "blue arrow" schematic where an additional table is constructed and I can sum on, essentially, rectangles build by using OFFSET on sell ranges with the MATCH function. I am stumped with how to go about this without the additional charts.
Thanks!

VBA would better for this, but use this formula in C30:
=IFERROR(SUM(SUMIF(OFFSET(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)),SEQUENCE($B30-$A30+1),IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))-SEQUENCE($B30-$A30+1,,0)>COLUMN($B$1),0-SEQUENCE($B30-$A30+1,,0),COLUMN($B$1)-COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))+1),1,IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))-SEQUENCE($B30-$A30+1,,0)<=COLUMN($B$1),(C$29-C$28+1)-SEQUENCE($B30-$A30+1,,-(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(C$28)))-COLUMN($B$1)-1)),C$29-C$28+1)),"<>")),0)
and this in D30:
=C30+SUM(SUMIF(OFFSET(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)),SEQUENCE($B30-$A30+1),IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))-SEQUENCE($B30-$A30+1,,0)>COLUMN($B$1),0-SEQUENCE($B30-$A30+1,,0),COLUMN($B$1)-COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))+1),1,IF(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))-SEQUENCE($B30-$A30+1,,0)<=COLUMN($B$1),(D$29-D$28+1)-SEQUENCE($B30-$A30+1,,-(COLUMN(OFFSET($B$1,$A30-MIN($B$2:$B$10),MIN($B$2:$B$10)-$A30+DAY(D$28)))-COLUMN($B$1)-1)),D$29-D$28+1)),"<>"))
And copy both down.
If one does not have the dynamic Array formula SEQUENCE() then replace all the SEQUENCE($B30-$A30+1) and SEQUENCE($B30-$A30+1,,0) with ROW($ZZ$1:INDEX($ZZ:$ZZ,$B30-$A30+1)) and (ROW($ZZ$1:INDEX($ZZ:$ZZ,$B30-$A30+1))-1) Respectively, and use Ctrl-Shift-Enter instead of Enter when exiting edit mode.

I was able to collaborate on a solution. I am told that it will be highly inefficient at scale but it gets the job done. It ss less automation-friendly but can be formulated to capture data not currently present on a, say, a pivot table that you call to update later by extending the area that the formula works on.
Formula in in I31:
=SUM(IF(($C$1:$O$1+OFFSET($B$2,$G31-$B$2,0):OFFSET($B$2,$H31-$B$2,0))>=I$29,OFFSET($C$2,$G31-$B$2,0):OFFSET($O$2,$H31-$B$2,0)))-SUM(IF(($C$1:$O$1+OFFSET($B$2,$G31-$B$2,0):OFFSET($B$2,$H31-$B$2,0))>I$30,OFFSET($C$2,$G31-$B$2,0):OFFSET($O$2,$H31-$B$2,0)))

Related

(MS Excel) Do you know a way of putting equation into cells?

I would like to achieve following as my spreadsheet is rather large and I always spend a lot of time figuring out some of my calculations that I made few weeks ago.
Just by looking at the formula, I cannot really say, which equation / correlation was used. Notes such as "this guys" (1967) for "some" ratio < "something" and ___ < "something" are also not as clear as putting equation next to it. If I cannot put it in a cell, it usually gets disarranged. Is there any trick.
Example of what I want to achieve (This was made in Numbers, which are otherwise inferior to MS Excel):
There are various 3rd party 'add-in' providers that you can utilise to assist with this (I used MathType for my MSc dissertation which included over 100 equations in tables etc.).
You can also use this to easily prepare a neatly aligned set of equations in MS Word (where I imagine your table is ultimately going, if not in Latex - although I could be wrong!).
To snap any object to a cell boundary, hold alt whist dragging it with your mouse in MS Excel.
To resize the object ensure you select "lock aspect ratio" to avoid undue distortion (equation objects need extra TLC as an incorrect aspect ratio for your equation can detract from credibility of your overall work!
jOptoins**
Sample
You of course can add a comment or note to the cell by Right-Clicking the cell.
If you want to include a comment in the formula itself...
HTH

Using Sumproduct to calculate two tables using horizontal (table headers) and vertical references

Hopefully the title makes some sense because I'm trying to wrap my head around the logic and I'm not quite sure how to phrase the question.I'll try to give a brief explanation of the end goal without over complicating it with unnecessary details.
I have a table of survey score averages for every month per person and a correlating table with the number of surveys each person received for each month. The logic is essentially multiple the score for each month by the number of surveys, combine them, divide by the total number of surveys within that time period to get their true average. Where things get a little complicated is that I have to include the ability to set a custom date range and return the value. So sometimes I might be looking at the average for Jan - Apr, other times I might just be looking at Feb-Mar etc.
I think sumproduct is going to get what I need done but I'm running into issues trying to write it out. I've written it several different ways and none of them worked so here's one that best conveys what I'm trying to do,
=SUMPRODUCT(--(F7:I7,L7:O7>=C2),--(F7:I7,L7:O7<=C3),--(E8:E12,K8:K12=B9),tbl_average[[Jan-20]:[Apr-20]],tbl_surveys[[Jan-20]:[Apr-20]])
I super appreciate any assistance I can get on this. I'm hoping the end result is not nearly as difficult as I'm making it out to be.
Some additional information:
I'm going to be using this same process to calculate multiple metrics across multiple worksheets.In the test example each of the tables will most likely be on different sheets. The dashboard with the calculated results will contain everyone's names and will be filtered and rearranged frequently, so I need to make sure we're always matching directly to their names and not just the relative rows. Basically, in my example I show that Agent 1 is always lined up on row 8 but that's not always going to be the case. Agent 1 could be in Row 8 on Sheet 1, Row 10 on Sheet 2, and Row 12 on Sheet 3 and I need all the correct values to multiply and sum against one another.

Analyzing 3 Dimensional data in MS Excel

Need help
I have to analyze traffic violations data with respect to place, month, and type of violation in MS Excel.
I can plot graph of Month vs Count of Violation in a place that gives me place where maximum violations took place in a month
and Month vs Count of Type of Violation that tells me which violation took place maximum in a month.
But the data I want is, How to get place of violation where a certain type of violation took place maximum time in a month. This data will allow me to plan to reduce violations and improve safety.
inshort:
I can make 2d Graph of Place of Violation(50 Places) vs Month
I can make 2d Graph of Type of Violation(15 types) vs Month
But I want a 3d Graph in MS Excel that supports Place of Violation vs Type of Violation vs Month.
Can you tell me how to achieve this? if there is some method to reduce 3d data into 2d, do let me know, I can try for that. Thanks.
Adding More info as per Comment
Lets say I have table like this
Now I can plot a 2d Bar Graph Between Month vs Count of Violation Type to determine that what violations has taken place in a month and with what count.
Another Bar graph would be Month vs Count of Place of Violation to get at what places most violations have been taken place in whole month.
But I want a 3 Column comparison graph in which I want to determine, in a month, what count of violation type has happened across different places.
like a 3d array
graph[month][place][count of specific violation type]
I hope that makes it clear, if not, let me know so I can paste the actual graphs.
Thanks
3D graphs are really hard for people to read and interpret. You might consider making a series of graphs by month (1 graph per month) if you really want to highlight monthly changes. If you just want to find the troublespots, you could graph place by violation and be done with it.
But if you are sold on a 3D graph, you could look at pivottables and pivotcharts. I graphed your dataset using a PivotTable with Date on the Axis Field and Violation and Place on the legend field and Count of Date for the Values. I then selected the Date column in my PivotTable and chose Group Selection from PivotTable Tools > Options in the ribbon, and grouped by month.
The end result was this monstrosity, but it sounds like that might be what you are looking for. I included the PivotTable chart and its options so you could see the setup.
Hope that helps!

Displaying multiple items in Excel graph and few calculation issues

I've done some Googling for each of my issues but haven't found exactly the results as I wanted. Things I need to be done doesn’t probably include any macros/VBA skills, just basic knowledge of Excel.
Now to my spreadsheet. I'm a Dota 2 player and I like statistics. I like it that much that I'd like to keep track of my achievements and results. Only problem is that the game tracker sucks and to get great information in web you have to pay for it, so I decided it's time for me to create my own spreadsheet to track my skills.
I don't know which place is the best to share my spreadsheet but I uploaded it to Estonian uploading host, link is here. I will also provide with pictures so you don't have to download anything.
This is what it looks like in general:
Problem number 1: The left table, or column has 1000 rows. In web design it's possible to make elements fixed depending on the scroll, I'd like to use similar feature here. If the table gets scrolled down, the right table (area with games, bonus and graph) will get scrolled down with it.
Problem number 2: Average MMR. I'd like to show average MMR after each entry depending on the first entries. Right now there's avg MMR for J4:J8. The calculation for J8 looks like this: =AVERAGE(C4:C8). For J7 it looks like this: =AVERAGE(C4:C7). I'd like to do this for all my 1000 rows, but I don't want to type it out. If I try to drag down from the corner, it will continue with C5:C8, C6:C9 etc (so it changes the starting point)
Problem number 3: Under longestGame there's currently Date and Hero. This should show the Date and Hero of which the longest game occurred. I tried to do this with LOOKUP function but it required table to be in ascending order, which I don't want. For current, 44,22, there should be Storm Spirit and 14.06.2015.
Problem number 4: Graph. I'd like to display three series on graph - MMR, average MMR and game length (time). The problem is, that MMR and average MMR will be in the numbers on 3000-7000 but the game length will only be probably in timeframe 20:00-120:00. Maybe it's possible to add two sets of values to the Y axis or maybe set Time series maximum 200:00 and minimum 0:00 and create graph according to this. I'm really stupid making graphs and I haven't figured out a clever way yet.
Problem number 5: Graph again. Right now I have to set the series for the graph. I've currently set it to C4:C54 (so 50 rows). I'd like it to move around a bit and by that I mean that if there happens to be C55-th game then the graph would start from C5:C55 and move along (so it'll count 50 last games).
I'm in a benevolent mood so rather than downvoting your question, because it is not really suitable for this forum I'm going to give you some hints and guidance. The numbers below correspond to the problems in your question.
Excel permits more than one window to be used on the same workbook -
so one window can show the data and one the summary.
Find out about absolute and relative cell addressing - its a valuable bit of knowledge for anyone serious about Excel and it will be of use in solving your problem.
Find out about the MATCH function. You can use this to find out which row of your table contains the longest game, shortest game, max MMR, min MMR by matching an element from the summary on the right (cols M onward) against the appropriate column table on the left. The find out about the INDEX function - this can be used to pull the values in the columns for Hero and Date which correspond to a specific row (such as the row containing the longest game, shortest game, etc). Search INDEX MATCH and find out why using these two functions in combination is often preferred to using the VLOOKUP function
Persevere - there are graph options available to do what you want and the only way to really learn is to go through the pain of trying them out, failing and working at it until you succeed.
Set up an area of worksheet to hold the 50*3 table of data for your graphs. Find out about the COUNT function and think how it might be of use in determining which rows of the data table map to the 50 rows of graph data. Then think about how to populate the graph data table using one of the functions mentioned above. Incidentally, C4:C54 is actually 51 rows, not 50.

Dynamic Excel 2007 Dashboard Without VBA

Morning guys,
I'm hoping that one (or more) of you can help me.
I have been tasked with creating a dashboard which needs to display trends and have a dynamic frontsheet, preferably with drop-down or data forms so as to update a chart / graph.
The information itself is incredibly limited - the scope of the document is tracking a value (0-4) assigned to a staff member's ability to fulfill a task, e.g. 'Quotes - 4', 'Cancellation - 2' and so on. So the metrics are limited to:
Month (a worksheet for each month of the year and one front for the dashboard)
Team (Presently 6 teams, but this is likely to increase over time, so hopefully the solution facilitates relatively easy incorporation of new teams)
Employee (Self explanatory)
Task (Presently 25, but as above - subject to change)
Score (the 0-4 value referred to above)
So as you can see, it's a very simple dataset. The sheets are presently set out with six grids with data validation lists for determining Team and Score (dropdowns for easy data input), with the Task being pre-written and the employee entered manually by the user.
What I'm hoping to do is have a frontsheet with dynamic tables that update accordingly when a dropdown and/or data form is changed. The key focus is on getting the staff members up to 4s for all tasks, so ultimately, the charts will display trends for the individual teams (one chart for each team - 6 charts) on a month-on-month basis and also a dynamic table which can reflect specific information (e.g. employee performance on a specific month, or number of '3s' achieved by a specific team to date).
I've read a reasonable amount on this, but seem to have overwhelmed myself with the sheer amount of options. However, the options can be narrowed given that I'm working on a large corporate network that doesn't really facilitate downloads (so add-ins or anything extraneous to Excel 2007 'out-the-box' isn't an option) and preferably without the use of VBA (1. I'm quite a novice insofar as VBA, 2. Easy distribution and maintainence of the document might be marred by VBA?), though I appreciate that my requirements may dictate VBA to be essential.
Does anyone have any suggestions around how best to proceed creation of this dashboard?
Any and all help is appreciated and I apologise as a newbie if I've contravened any conventions around forum etiquette.
Thank you all for your time,
Rob
There are a couple of things that you need to consider in a task such as this:
a) what sort of output do you require?
b) how are you going to manage the data?
For a) I'd separate it further into the basics of what's required (time series charts of employee and/or team performances [how will team performance be measured? average, % achieving 4, or ?]) and then the bells and whistles of drop-downs. Focus on the basics, the other stuff first the whizzy stuff can come later. Getting b) right is vital - you are going to be extracting subsets of the data to build the charts you want to display. Get b) wrong and you'll just create a horrible task for yourself.
In your position I would consider re-organising the data into the form of a table. Excel's help defines what is meant by a table, but in essence it is a list of your observations where each observation simply comprises the score for a particular month/team/employee/task combination (so each observation comprises 5 values). The observations are arranged as successive rows of the table with the first row being the header row which will contain suitable labels such as "Month", "Team", "Employee", "Task", "Score". The real advantage of using a table such as this is that Excel provides a heap of in-built facilities for manipulating them - look up the help for Sort and Filter on the Data tab. In your case there is an even more compelling reason for using a table - you can use the Pivot Table and Pivot Chart facilities for analysing and displaying the data. If you have not used these before some time and effort spent learning about them will pay dividends. Once your data is organised and you know how to use Pivot Tables and Charts you should be able to prototype sum output very quickly.
If you do decide to organise your data as a table you can still keep a nice friendly looking grid of 6 team "tables" (different from Excel's use of the word) as a data entry facility to enter each month's scores by employee and task. You will need to find a way of getting each month's data from the data entry "tables" to the main data table. (Easiest way would be to use a bit of spare worksheet under the data entry tables to reproduce the entered data as a series of observation rows and then use Paste Special Values to append these rows to the end of the main table of observations. You can use VBA to automate the copy/paste operation if you want, you just need to figure out a way of identifying how may observations are currently in the main table and precisely where you want the paste to end up - COUNT() or COUNTA() is a useful friend here). Main problem to avoid (whether automated or not) is to avoid appending same entered data more than once to main data table.
Have a look at http://www.mediafire.com/download/x64swkp689k10a1/DataEntrytoTable.xlsx for a simple example of some of the above thoughts

Resources