Domanda

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:

enter image description here

Chart:

enter image description here

È stato utile?

Soluzione

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. enter image description here

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%

enter image description here

Then set the Billions format as 0,,,;"";0

enter image description here

You will get something like this:

enter image description here

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

enter image description here

Select the non-Billion series (plural!) and check the secondary axis

enter image description here

If the larger data is always positive then you can use custom formatting to clean up the axis

enter image description here

Align the primary and secondary axes so that the grid lines match on both

enter image description here enter image description here

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?

enter image description here

Altri suggerimenti

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:

SO20887139 example

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:

  1. 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.

  2. 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.

  3. 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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top