Stacked chart for budgeting example - excel

I have data in three columns:
01.1.2010 Spent 555
01.1.2012 Planned 34343
01.1.2012 Spent 6565
01.1.2014 Planned 34312
01.1.2015 Planned 2323
I wish to create a stacked chart where the horizontal axis will have only dates, and if there's data, stack the planned amount and spent amount in one bar. So in this case I should have four columns and the column for 2012 date should be stacked with Planned first (one color) and Spent (different color).
How might I achieve this?

Might be easiest to rearrange your source and then allow Excel to 'do its thing':

Related

Excel - bar chart w series overlapp

Currently I have a grouped bar chart with a value on the y-axis (total guest nights in an area), and the months on the x-axis.
I have 2 series as of now: 2020 and 2019 - they are quite close to each other for each months so that you see that these relate to one another.
NOW I wanted to break each of these series into a more detailed aggregate.
The total guest nights each bar represent I now want the bar to aggregate the value for each market - whether domestic or abroad (so 2 components should now constitute the earlier total sum)
My idea doing this was (which I know work if I had just 1 year - e.g. 2019), is to put the e.g. abroad as the total amount and the domestic as domestic - then just use 100% series overlap.
BUT if I do this now - of course this happens to both my series related to e.g. 2019 but also for 2020 (which I do not want)..
I tried making use of the secondary y-axis for the 2020 series - but that didn't help at all - Excel still relate series overlap (on the x-axis) the same regardless of me making use of the 2nd-y-axis.
Do you understand my question?
I essence I want a stacked bar chart for 2 series (or in practicality 4).
Thanks!

Pivotchart - How to include out-of-chart data for multi-period moving average trend lines

About the chart
I have a pivot chart based on a table with historical data and seek to report only the past 12 months of data. Furthermore, the chart is connected to a slicer with a twelve month period selected. For each series of data (Green, Blue, Grey) i have added a three period moving average trend line.
My problem
As shown below, the moving average trend lines start from the third month onward, naturally as there are insufficient data within the chart to calculate a trend before month three.
My question
Is it possible to include data prior to the first charted period from the source table (which is available) to calculate the 3-period moving average in a pivot table?
To clarify, i want to keep twelve periods in the bar chart, but
include fourteen periods for the moving average calculation to achieve full
twelve-period trend lines

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.

Determining the optimal excel chart major unit

one of my tasks is updating a presentation with zillion charts.
Since there are 4 charts per slide it is important that the major unit on a chart is set so that the charts are legible.
I found a way to code some steps and cut the time significantly but one of the missing pieces is determining the major unit of a chart.
So the question is:
Is there a way to to determine through formulas or vba what should be the major unit in a date type x axis based on the dynamic start date and end date (I want last date to be shown on a graph)
Bellow is the example:
dates are having one week interval
I need the final date that shows up in pivot to be on the chart
I need the chart dates to be legible given that it will take quarter of a slide
chart example
I tried going through similar questions and one of the solutions (that didnt work for me) was:
using Days360 to calculate number of days between start and end date
adding 1 to be inclusive of start and end day
dividing that number of days with number of wanted ticks minus one
so far I was using 27 as a number of ticks, based on legibility experience
If I find a way to precisely determine a number to be used I will use it as a reference # for my macro that changes all the applicable charts
Could anyone help me out please?

Display continuous dates in Pivot Chart

I have a set of data in a pivot table with date times and events. I've made a pivot chart with this data, and grouped the data by day and year, then display a count of events for each day. So, my horizontal axis goes from 19 March 2007 to 11 May 2010, and my vertical axis is numeric, going from zero to 140.
For some days, I have zero events. These days don't seem to be shown on the horizontal axis, so 2008 is narrower than 2009.
How do I display a count of zero for days with no events?
I'd like my horizontal axis to be continuous, so that it does not miss any days, and every month ends up taking up the same amount of horizontal space.
(This question is similar to the unanswered question here, but I'd rather not generate a table of all the days in the last x number of years just to get a smooth plot!)
What Douglas said pointed me in the right direction, but what I did was in the pivot table, right=-click on a date, and clicked on field settings, layout and print, and checked "show items with no data". This is in Excel '07, btw.
Select an cell in the data series, on the Pivot Table Options tab, click on Setting for this field, click on the second tab, Layout, then check the "Show labels for missing data" option. This seems to do the job - to the extent of including a Feb 29 for every year. Need to investigate that one some more.

Resources