Excel 2013 Why is standard deviation not evenly stretched to both sided up and down? - excel

I calculated data in Matlab.
Now I want to format it in excel.
The values in first row represents some average values. The values in second row represents standard deviation.
I try to draw a graph, but standard deviation bars do not strech up and down evenly, as they should.
I want to achieve graph like this:
https://en.wikipedia.org/wiki/Error_bar
I am using Microsoft Excel 2010.

I found an answer here:
https://www.youtube.com/watch?v=2Etko-slowk
It is VERY important you delete all the data, when you set custom values from both textboxes (after you click specify values).

Related

Prevent Excel from changing x-axis on a dynamic chart

I wanted to make a dynamic chart that plots out the graph of a standard curve for a bio assay we perform frequently. Often to boost the fit of the curve you may drop one or two data points on either end of the data set. So using vlookups and if statements I have a scheme that performs that data trimming, such that my data always starts in Row 1 and the column length simply shortens.
My table works great, but my xy scatter chart goes bananas on these changes. I have the plot on a log log scale, which looks fine if the full data set is present. I lose the x axis detail when I perform a trim. The x- axis then resets to range of 1 to length of my data set.
How can I prevent this?
UPDATE
I added some information. I know there are VBA ways to do this but I would prefer to keep the spreadsheet as simple as possible. I would think excel should be able to handle this.
So if I have a bad fit I may want to trim the data series either from the beginning or end of the data set. I accomplish that with the spinner buttons to dynamically change the table but the following happens
My formula that updates the columns looks like the following. Its messy.
=IF(ISNA(IF(VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1>8-($B$5-1),"",INDEX(C$4:C$11,VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1))),"",IF(VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1>8-($B$5-1),"",INDEX(C$4:C$11,VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1)))
In the formulas use NA() instead of "". Filling cell with "" does not result in a true empty cell and is the reason why you are experiencing issues with your chart.
Hope that helps.
I may be missing the obvious here, but just hard-code the graph with a range of your choosing. In the sample screenshot, making the graph auto defaults the max range to 100,000. I went in and hard-coded the maximum to 50,000 (circled). Afterwards, the 5th data point is not displayed in the chart. Doesn't matter what the data shows at this point.

Why Excel graphs are adding empty data points?

I want to plot the sales on specific dates. But of course there hasn't been sales on some weekends and holidays, so i dont want to plot these days. Just skip these days in the graph. But as soon as i create a bar chart in excel and select the data points, excel automatically put the other dates in without data. How can i force excel to show only the data points i provide?
I attached to data point and the graph which excel creates.
http://imgur.com/a/RzN1l
http://imgur.com/a/Tx6dm
In the colum (or row) of data representing your dates, ensure they are string literals and not date values. You can do this by prepending a single-quote, e.g.:
'14/04/2017
Strictly speaking, you only need to do this to the first date.
easiest way is to format the x axis with the following option: Axis Type: Text Axis

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.

can histogram function in analysis toolpak update results when input data is updated?

I am using histogram and correlation functions in Analysis Toolpak and need the results to be updated as I change my input data or references. Is this possible in some way?
thanks
Yes, you can do this with the Frequency function. Run the Histogram tool once to set up the bins and initial frequencies. You probably want a chart, so make sure to check the Chart Output option.
Now, select the frequencies and type (for example) =FREQUENCY(D1:D41,H3:H9). Replace the first argument with the range that contains your data, and the second argument with the range of your bins. The output of Frequencyis an array, so you need to select all of your frequencies before enter the function and then use Shift+Ctrl+Enter to enter the function.
This will dynamically update the frequency counts based on the initial bins. If you want, you could also calculate the bin ranges using some formula that creates them using a suitable methodology.
You can create your own histogram chart using the same bins and frequencies. Just calculate them as above, and then create a Column chart of the frequencies with the bins as the x-axis labels. This way you don't rely on the Histogram tool at all.
Instead of using the Analysis Toolpak, you can use a pivot table (and PivotChart) to create a histogram:
1) Put your data into both the "Rows" and "Sum" areas of the pivot table.
2) Click somewhere in the pivot table column that has your row data (not the count of your data) and select "Group".
3) Use the "Group" dialog box to set your bin parameters.
Note: with this solution, your data is not exactly updated automatically. You need to click within the PivotTable, then select "Analyze > Refresh".

how to create percentage bar chart in excel, similar to "100% stacked column" but with one variable against total value

I thought over a lot for this case, I need to plot a series as percentage value of another series.
e.g, series A is the capacity and B is the usage. I want a percentage plot of B on A. Initially I did this by creating a 100% stack chart with series B vs (A-B). I computed (A-B) on a separate column and used that as a series for this purpose. So far so good.
But now I want to generate multiple charts like this (say 12 different graphs for 12 months' usage). I have 12 columns of usage data and one column of fixed capacity data.
Is there a way to auto-generate this chart without having to create 12 intermediate columns with formula. It seems logical that Excel should have a chart type for representing A on B, just as they have one for A,B on A+B.
Sorry if I am too lengthy or confusing in my description. I did my best here to explain.
Actually I am trying to do the same thing I figured it out. If you have Excel 2007 (not sure if this feature is available in older versions). Select all 3 colums, 1 with the names of your variables, total count, and subtotal of what you are counting. Select column chart. Once the chart is created, right click to format the data series. Under series options there is a slidebar for series overlap, change this value to 100% and wahla, the the 2nd series becomes a percent of the total. Hope this helps!
Excel has common chart types, but even Microsoft doesn't have the resources to provide every possible combination of charting styles. And users are confused enough with the currently available styles.
Excel charts plot the data that they are given. If you need to plot A as a percentage of B, you will need to compute the percentage in a range, and plot this range.
The way I would do this is not to modify the ranges on the worksheet at all.
Write a new function that creates the modified range data you need so that you can return this and use it inside of ApplyTemplate method when creating the chart. The only downside to this is you would need to run a macro/vsto ribbon button to update the chart. as opposed to getting that behaviour for free with a worksheet bound approach.

Resources