How to recreate a bar chart of event times in Excel - excel

Trying to recreate this first graph in excel using the data below it.

Solved this by making the times regular integers, then calculating the start to end difference for each date, widening the data to split the differences among three categories. I then highlighted only the dates and start times, pressed control, and highlighted the 3 columns with the differences.
I selected stacked bar chart, which looked like this by default.
Lastly, I selected the (blue) start time bars and chose no fill as the color. After deleting this series from the legend, the result adequately matched the requirements.

Related

Variable-base column bar graph

I am trying to get a variable-base column bar graph in Excel. Basically, with reference to the figure below, I have a number of periods. Each period can range from 1 to 5 months. So the various periods do not have the same length. Each period, however, has only one value associated with it that is representative of the entire period.
What I wish to achieve can be seen in the first figure (A), where two characteristics that the graph must have are also highlighted, namely, to consist of columns of varying width, as well as height, and to have the final month of the period placed in the center of the column and not at the bottom right.
I have tried several ways to get this graph with Excel, but all I have been able to get is visible in the second figure (B). Basically, I had to create a second, auxiliary, table by hand from the first, and then generate a normal column chart.
Clearly the result is different from what I wanted, although I came close.
Do you think it is possible, with Excel, to get exactly the chart I need without having to use a second table? Or, alternatively, do you think there are other programs, e.g., Holoviews (Python) to get the expected result?

How to color data series point inside plot graph depending on data value in Excel table

On a data/line plot inside Excel, I'd like to color my data points depending on a value inside the table on the same row as the data value, however from a different column.
It's best explained with a picture:
It's essentially a line chart type with the lines removed, and the data points set to bullet type and given an increased radius for visibility. The x-axis denotes the calendar date as dd.mm, and the y-axis contains the values.
Now the Excel table also contains a row called "Time of Day", which can be mo(rning), mi(dday), ev(ening).
Can something like this be done with a line chart, or do I need to use a different type of chart, or is this generally not possible in Excel (which I doubt)?
Excel in use is: Microsoft Excel for Mac, Version 16.51 (21071101).
Here's a way to achieve this:
What I've done is:
Added three columns for the times of day (columns B, C and D). These can be hidden.
Added this formula in B2: =IF($E2=B$1,$F2,NA()) which should then be dragged to cover the next two columns and then down to cover every day.
Selected A1:D11 (it'll be more than 11 on your version)
Went to Insert > Chart > Insert Line or Area Chart > Line With Markers
At this point you have a line chart with three series (mo, mi, ev). The lines can be removed, which just leaves the markers. You can format each series separately, with different colours, shapes, sizes, etc.
As a special bonus, this automatically gives you a legend that explains the colours.

Excel stacked line chart shows transition to 0 when empty cell but I don't want it to

I have 2 sets of actual data that need to be stacked. At the current month I want to show 2 sets of projected data also stacked but the transition is currently gradual as if the empty cells are treated as zeroes. I want a vertical separation between the actual and projected.
I'm using Excel (2013). I've tried:
- The Hidden and Empty cells setting... but it locked on Zero (other options greyed out)
- Using #N/A
- Changing ranges (this works when the gap is at the end but not for the Projected values.
Separate the data with the zero into two series ie either side of the zero , then plot the two series ie left part and right part.
Another way would be to have a second chart, transarent except for the second part of the data series sitting on top...
Used to do that with forecasting based on previous values, what looked like one line actually had two charts overlaid one on the other.
So, based on the comment built this:
So, you can now follow and complete the detail you need.

Excel: Z-Order of Series in Chart and Legend

I have a combo chart in excel, with clustered bar charts (for a box plot) and lines. I am trying to display the bar charts/box plot in front of the lines, but am able to do so.
I tried moving the bar charts to the top and/or bottom in "select data" - but no change.
Any suggestions?
Am using Excel 2013.
Thanks!
I believe it is not possible. You can change display ordering of Excel series by:
changing the plot order of the series (this is what you have done in the "Select data" dialog),
changing the axis on which the series are displayed (series on secondary axis are displayed over the series on the primary axis).
But from my experiments no combination of changes makes the lines appear behind the columns.
There are two workarounds that might or might not help you:
you can create two charts on top of each other and put the chart with the lines behind the one with the columns,
or you could create a line chart (most likely you would need scatter chart), that is not a single line but a series of segments where the columns are not shown (this one is not that easy to do)
What are the lines for? If you are just trying to identify some zones along the value axis, you could instead use stacked areas, which would give a banded appearance. Areas are always drawn behind bars and columns, while lines are always drawn in front of lines and columns.

Excel Chart doesn't keep format

I have a table (came from a pivot table) where I have formatted the column 4 cells to show 1 billion as 1. But when I select the table and insert a chart, I am getting my units in millions. So the 14.8 billion number for Mexico is showing up as 14,800 on the chart. Why might this be happening and how can I fix this? This is also making all my other bars negligibly small. Note that the first three columns are not in billions and are totally different things. Some are percentages, some are other small numbers.
Table:
Chart:
You need a secondary horizontal axis and some formatting on the Axes.
In Excel 2013
First change the Chart Type to Combo and select Clustered Bar for both sets of data, then Check
Secondary Axis for the Percentage Series.
Then set up the axis limits so they match, e.g.
Percentage: min -.5 max 2
Billions: min -5e9 max 20e9
Then set the percentage format on the source data to a custom Number format of "";(0)%;0%
Then set the Billions format as 0,,,;"";0
You will get something like this:
EDIT
Now that we have the general principles, we can apply them to your specific data.
I will also switch to Excel 2010 do show the different menus.
The data selection looks like this
Select the non-Billion series (plural!) and check the secondary axis
If the larger data is always positive then you can use custom formatting to clean up the axis
Align the primary and secondary axes so that the grid lines match on both
The end result is clean and readable.
Mixing percentages and numbers for the smaller numbers is not handled by this but I would suggest that that would be confusing anyway?
The simplest way to fix this might be to plot cells containing the billions values divided by 10^9 rather than to plot the billions themselves, though via a secondary axis may be possible.
Using Excel 2007. For the purple bars, the example on the left uses ColumnE values, on the right ColumnF values. E1 contains =F1/10^9 and F1 contains =14800000000:
It appears that there are 3 questions here: 1) "Why might this be happening", 2) "how can I fix this", and 3) something like "how can I plot data which lie on two widely differing ranges, and make them all reasonably visible anyway", even if there was no explicit question on this.
There are several ways to solve issue #2 about the units (e.g., billions) and numbers (e.g., 14.8 vs. 14,800.0) shown in the axis, each one with its own pros and cons:
Use Format Axis -> Axis Options -> Display units.
This might be the answer to your issue #1 as well, you might have the following selection: Display units -> Millions, and unchecked Show display units... Otherwise, I wouldn't know why you chart shows what it shows.
Use faked tick marks, as indicated in the (excellent) site of Jon Peltier
http://peltiertech.com/Excel/Charts/ArbitraryAxis.html
It gives detailed instructions on how to create tick marks on an axis with arbitrary labels (which may be text, numbers, etc.), which is more generic than what the OP wants here. In this particular case, the labels will be the desired numbers.
Create new cells containing data that would be plotted exactly the way you want.
As for your issue #3, I guess the only option is to have a Secondary Axis (see the answer by pnuts).
Thus, to come up with the best final chart for you might use a combination of one of the options I gave here and a secondary axis.

Resources