Group values into an "others bucket" - excel

I have a list (30+) of users with the number of times those users were active per month in my system. I'm using an Excel chart to show which users have been consistently active over time. About one third of the users come consistently (several times a month) while others come one month and not another.
Unfortunately since I have 30+ users, the colors in the Excel chart are difficult to distinguish from one another. What I was thinking to remedy this was to only show the top 10 (or 15) users and group the others into an "others" or "catch-all" bucket and still shows it in the chart.
A sample image of the chart:
What's the best way to do this?

Add a column that differentiates 'Active' from 'Non-active'. In the sample I had to create overall B and C were the most active so I populated D2 down with:
=IF(OR(B2="B",B2="C"),"Active","Non-active")
Adjust the formula if that distinction is made on a month by month basis. Create a Stacked Column PivotChart and in the PivotTable move the 'Active' together as necessary. Select each of the Non-active series (here only two for illustration) in the chart and apply the same colour fill to all.

Related

Top 3 Values for Multiple Categories based on hours in a week

I'm working on a charging matrix where project managers can input time to the top three contracts in each category based on a week to week basis. Right now I have a pivot table with the categories (Production, Spares, Development) with multiple contracts that were charged that week. I manually select the top three from each category and copy into a table where I have formulas creating charge numbers for the project managers to use.
The question is, is there a way I can automate selecting the top 3 contracts from each category based on number of hours for that specific week?
Pivot Table & Charging Matrix
You can use LARGE() to get the top 3 (large(data,1) etc)
Then use index() and match() to get the contract names.
I have made a simple example here, but it will not deal with duplicate results in the hours if they are in the top 3...
There are solutions to that already posted.
If I understand you correctly, you want to automate the process of finding the top 3 contracts under each category and then create the charge number based on the results.
You can do so by creating a new pivot table as demonstrated below, put the Category Name and Contract Name in the Rows field, and put the Hours in the Values field, then right click anywhere within the Row Labels column of the pivot table, go to Filter -> Top 10... -> enter 3 in the second field, then you should have the top three contracts for each category.
P.s. You can choose to sort the hours from largest to smallest, and choose NOT to show the subtotals for each category.
Once you have the list, you can enter your formula (I presume you used a formula) in corresponding cells in column H (as in my example) to create the desired charge number.

Pie chart in SSRS

I have a report with 2 pie charts, giving sales data for product groups. Running a dataset from an OLAP cube.
I want to be able to select 2 different dates for each chart.
Example; Someone wants to compare November sales to the previous month. So one chart to display October, one to display November. Or they might want to see how Jan/Feb/Mar compare to Apr/May/Jun.
Can this be done from the same dataset, or do I need to point each chart to a separate dataset?
If the dataset returns the data for both months, you could add filters to each chart to show the appropriate one. However, it sounds like you'd want this to be more dynamic.
I would suggest creating two separate datasets, each with a month parameter. This will allow the user to select any combination of two months. The charts would simply point to their respective dataset. You shouldn't incur a noticeable performance hit either way.

Creating bar graph of event occurrences for each month of several years in excel

I have a long list of dates (about 2000) in an excel spreadsheet and I want to see how many of these dates lie within particular years (and roughly which part of the year also if possible). I know how to make basic graphs in excel, but I'm not sure how to make a bar graph that uses dates. Any suggestions?
I can obviously split events in day, month, and year and then use count to count the amount of each year, but this would not show the placement of the event within the year in the final graph.
20/03/2000
2/04/2000
3/04/2000
26/05/2000
7/06/2000
20/06/2000
22/06/2000
10/07/2000
12/07/2000
22/07/2000
2/08/2000
8/08/2000
11/08/2000
14/08/2000
15/08/2000
12/09/2000
15/09/2000
20/09/2000
25/09/2000
2/10/2000
22/10/2000
24/10/2000
25/10/2000
27/10/2000
1/11/2000
10/11/2000
13/11/2000
16/11/2000
18/11/2000
20/11/2000
25/11/2000
27/11/2000
3/12/2000
6/12/2000
20/12/2000
21/12/2000
22/12/2000
4/01/2001
7/01/2001
11/01/2001
24/01/2001
25/01/2001
2/02/2001
4/02/2001
9/02/2001
12/02/2001
13/02/2001
20/02/2001
21/02/2001
2/03/2001
11/04/2001
19/04/2001
20/04/2001
21/04/2001
24/04/2001
27/04/2001
28/04/2001
2/05/2001
3/05/2001
5/05/2001
12/05/2001
13/06/2001
20/06/2001
25/06/2001
3/07/2001
5/07/2001
18/07/2001
20/07/2001
21/07/2001
22/07/2001
25/07/2001
4/08/2001
5/08/2001
9/08/2001
10/08/2001
11/08/2001
12/08/2001
13/08/2001
31/08/2001
11/09/2001
12/09/2001
17/09/2001
3/10/2001
10/10/2001
18/10/2001
21/10/2001
23/10/2001
4/11/2001
5/11/2001
17/11/2001
22/11/2001
23/11/2001
27/11/2001
29/11/2001
3/12/2001
I cannot check this in earlier versions of Excel, but in Excel 2016, if you build a Pivot Table with your data and drop the date in the Rows - you get your data grouped in Years, Quarters, and Months. If you also drop the date into Values, then you get the Count of values in each year, quarter, and month.
Then a pivot chart looks like this ...
A less magical way to do it
Applies to Excel 2013 and up
From your single column of dates, build a pivot table.
Put the date in Rows. Put Count of date in Values.
Select any one of the dates. Right Click and choose "Group...", or choose "Group Selection" from the Analyze ribbon.
Click on each of Months, Quarters, and Years.
Filter how you would like.
Select PivotChart from the Analyze Ribbon.
You can create a scatter graph as suggested in the comment. Consider your data set and see if there is any other quality that could be added to the chart, which could be plotted on the value axis. For example the number of people attending the event, or the duration of the event in seconds, or something like that, so that the graph contains more information. In the following screenshot, the blue dots are just the 1's from column B plotted on the time line. The orange dots plot another data aspect on the vertical axis.
If you create a pivot table of the dates and drag the date into the Sums area you will get a count of each day, make sure this is sorted. Then a chart will show the number of records for each day. You will need to copy and past values from the pivot to a new sheet to be able to make a scatter diagram from the output of the pivot table (in Excel 2010). But once it is a scatter diagram the events will be in the "correct" places.
If you wanted to group it by month instead you could use a formula to create a column of year & month and then do the pivot and chart on that column. For example the formula below will give you 201605 for May 2016.
=YEAR(A2)&RIGHT(100+MONTH(A2),2)
Weeks would be a bit trickier, but I suppose you could divide the date by seven and then INT it to get a 7 day grouping. These wont show the actual events occurance within the period but would let you see which periods have the most events.If you are looking for things like more events at the beginning of the month or something you might need to try different "groupings" like weekly.

Can I display daily data in month buckets using only excel's chart formatting?

I have daily sales figures that I'd like to plot on a simple linegraph.
I would like them to be shown in monthly buckets (i.e. if I sold 5€ on Jan 01 and 10€ on Jan 24, I would like to see only one data point for January with 15€ in it).
Please note that I don't want to use any supporting formula/VBA script, I want to do this using only chart formatting.
I tried setting the chart's X-axis type to "date axis" and I chose "months" as the base unit.
This almost works, but the line graph ends up being kind of weird. Changing the chart type to histogram doesn't help much either. The individual sales are not "piled up" like I would but, instead, they're hidden one behind the other. Stacked histogram doesn't work either.
Any clue on how I can force excel to bucketize my data using only chart formatting? This can't be that hard...
Try creating a pivot chart, then grouping the dates by month (right-click a date in the pivot table, and click "Group by... Month".
If you want to group by Years as well - hold down the Ctrl Key whilst you select the Month (both categories will then show up)

Draw an Excel Line Chart of my account balance

I made a table with my earnings and cash disbursements. And I list the account balance.
Now I want to draw the account balance in a line chart. But the problem is that there isn't a value on every day. So the line between to entries is different because different time lies between two entries. Sometimes three days, sometimes 22 days, ...
How can I realize, that the line is constant after a value and the line only change on a day, with a new value?
Edit (from comment): I'm using Excel 2007
Like the others have said, to get the true time difference between your points to show up, you have to use a scatter plot instead of the Excel line graph.
To display the true state of your balance at in-between dates (i.e., no sloping lines), you'll need to do some transformation of your data. It amounts to creating two new columns of data with duplicate points for each balance: one at the date the account balance reached that level, and one at the date the balance left that level.
I suggest the following:
To populate your Balance column, in the first cell (I'm starting my table at E2) enter
=B2
where B2 is the address of the first balance in your original table. In the next cell down enter
=IF(E2<>E1,E2,OFFSET(B$2,COUNT(E$2:E2)/2,0))
Fill down this formula as far as you need to.
Then in the first cell of the Date column of your new table (I'm starting at D2) enter
=A2
where A2 is the first date in your original table. In the next cell down enter
=IF(E3=E2,OFFSET(A$2,COUNT(E$2:E3)/2,0),D2)
Fill down this formula. Then use this new table as your source data for the scatter plot. Here's a screen capture of a sample:
Are you using an XY-Scatter Plot. A line chart adds in the missing days automatically. Make sure your x-axis is formatted as date.
If you insist on using XY-Scatter Plot then you can put in days for each day, if that day doesn't have data then for the y-axis put in =NA().
I think the chart you need is a step line chart based on your description. The answer of #Excelll above has already pointed out a way to do this in Excel. But here I've another solution that could avoid manually adding some rows to your data. You could use the Funfun Excel add-in to create step line chart. Here is an example that I draw.
As you could see there is some code in the Excel. The Funfun Excel add-in allows you to use JavaScript code directly in Excel so that you could use powerful libraries like HighCharts.js or D3.js to draw charts that could be difficult in Excel alone. In this example, I used HighCharts.js. And it's quite easy to plot this chart since HighCharts.js iteself supports step line chart, so all you need to do is add the step option in your code like the code below.
series: [{
name: "Balance",
data: balance,
step: true,
showInLegend: false
}]
Another advantage of the chart that I showed you comparing to other solution is that you get real time interval in your x-axis. As you mentioned, you may not take record of your balance everyday, the x-axis in the example above shows irregular time interval.
The Funfun also has an online editor in which you could explore your JavaScript code and result. You could check the detail of how I made the example chart in the link below.
https://www.funfun.io/1/#/edit/5a4e478f1010eb73fe125cb2
Once you are satisfied with the result you achieved in the online editor, you could easily load the result into your Excel using the URL above. But of course, first you need to add the Funfun add-in into your Excel by Insert - Office Add-ins. Here are some screenshots showing how you load the example into you Excel.
Disclosure: I'm a developer of Funfun
Excel is really rubbish at charting this kind of thing. In my experience, the best way to chart it is to start with an X-Y plot rather than a line graph, and select the option where it joins the points with a line.
You may also need to add a new column showing "days since start", and use that as the X axis instead of the date - I can't remember whether Excel 2007 can deal with dates properly or not. Try it and see.
Finally, if you include any cells in your chart that are not yet populated (eg because you want to make the chart from the whole column even though you only have a few entries so far), you need to have the empty cells populated with "#N/A" otherwise it will plot them as 0.

Resources