Exclude '0' values from an Excel 2010 column chart - excel

Is there any way to exclude values from a chart that are '0'? The data source is a mixture of vlookup's or sums where the results have a value others are '0'. When I plot the chart and there are some axis points with all '0' - can these be excluded to only show columns with data present?
Changing the source data to blank cells stills plots the data. There is an option on the line charts to join/connect empty cells but there is no function that I am aware of for a column chart.

Indeed it is:
Change your formula(s) to an if statement, so that it return NA() instead of 0. The chart won't show/include N/A values, however the label will be viable still as a standard. You may hide this label.
This method will work in this case if I understood your OP correctly. However, it may not work in all cases, as hiding 0-values from graphs may or may not require a different approach.

Related

Ignore Certain Cells on Excel Bar Chart

I am trying to make a concise Excel Bar Chart. I have a data set which has 245 data points on a single row. I would like to make a bar chart of this row however I would like Excel to ignore the rows with very low values.
In order to achieve this conversion, I have written this formula to convert the small numbers in the data set to #N/A:
=IF(OR(D47<0.01;ISBLANK(D47));NA();D47)
This formula successfully converts any number in my dataset which is smaller than 0.01 to the cell value #N/A. However, when I plot my bar graph, I still see the empty cells on the X-axis and this makes the graph appear huge.
What I want from Excel is just to hide the #N/A valued cells in the graph so the graph would be much more readable. How do you think I can fix this problem? Thank you very much for your time in advance.
Here is what the current graph looks like:
Hard to read chart
To sum up, I would like to remove all the cells which are not visible on the graph so the x-axis will resize itself to make the bars with values thicker.
Hide the rows with #N/A. This can quickly be done with a filter

Can't use INDIRECT in a named range used by an Excel chart

I am setting up several charts that are designed to dynamically select the last rows in a data set, or the number of available rows, if that's smaller. I have that set up and working, but I want all of the charts to use a (dynamically sized) range for the category axis values as well, and I'm running into trouble with that.
If I have categories in column A and values in column B, and a named value 'chtLen, then, say 'values' is a dynamically named range defined by =OFFSET(Sheet1!$B$1,COUNT(Sheet1!$B:$B),0,-MIN(chtLen,COUNT(Sheet1!$B:$B)),1)
Then it's simple to create a 'categories' value as =OFFSET(values,0,-1)
An Excel chart will accept =Book1.xlsx!categories as the range for the category axis values, and everything works. But if I want to always use column A, and grab a range in that column, that is, I want to change 'categories to =OFFSET(INDIRECT(ADDRESS(MIN(ROW(Book1.xlsx!values)),1)),0,0,COUNT(Book1.xlsx!values),1)
While still in the named value editor, both of those options will correctly select the same range. But when I try to change 'categories' to the latter formula, the category axis disappears from the chart. Attempting to edit or add =Book1.xlsx!categories to the chart with that definition results in 'Excel found a problem ... check that cell references, range names, defined names and links to other workbooks in your formulas are correct'.
The only thing I think I am changing is how I am arriving at a range. What am I missing?
I wanted to make sure I shared the solution I got to work. Instead of relying on the ADDRESS/INDIRECT functions, I just did simple algebra. It's ugle, and includes off-by-one errors that have to be corrected, but this works, regardless of the length of the data set:
=offset($A$1, ROW(values)+ROWS(values)-2, 0, -ROWS(values), 1)
That is, if I know I always want to draw my category values from column A, this will figure out how many rows down from the top of the category column my last data point is, and offset down that far, then offset 0 rows, then make the length the same length as the data set, going back up, and the result is one column wide. Not pretty but it works.

Suppressing Data Labels in Excel if #N/A Value

In Excel, I have a column chart with data labels. The source data consists of formulas which occasionally result in #N/A values. Currently, the data labels for #N/A points are literally displayed as "#N/A". Is there any way I can have Excel suppress the data label altogether if the underlying value is #N/A? If I use =IFERROR(A1,""), then that displays a 0 so that does not work.
You could set the number format of the labels to not display anything when it interprets a zero, if you don't want to display anything even when the formulas evaluate to zero.
There is a very in depth discussion of techniques such as this here:
http://www.mrexcel.com/forum/excel-questions/568361-charts-data-labels-using-%3Dna.html
I had this problem as well and found the easiest solution is to
duplicate the chart data fields
add those as new series to the chart data
change the series chart type for the new fields to a line chart with no line and no marker
show the data labels only for those new fields.
(column charts will show #N/A, line charts do not).

Excel - dynamic chart x axis - ignore x categories with no data

I have a predefined list of x labels, e.g. months of the year.
I want to dynamically exclude some of these from my excel plot, e.g. if some of the y values are blank, zero or errors.
Things I've tried:
If I use an (if data is bad, then change xlabel to blank or NA())
process, excel still leaves a space for the blank or #N/A x label - see image. This is the second most upvoted answer to Creating a chart in Excel that ignores #N/A or blank cells, but doesn't quite do what I'm after... Unfortunately, there is no option for 'No Gaps' in the Hidden and Empty Cell Settings.
If I filter out rows where the Y values meet the reject condition, I get the chart I want, but the filter doesn't update automatically when the Y values get changed by a calculation elsewhere, ie its not dynamic. Pivot charts are the same.
I can't get formulaic named ranges (Excel charts - setting series end dynamically) to do what I want - the formula will return something like 'Jan, FALSE, Mar, Apr' rather than 'Jan, Mar, Apr', and we end up with the same problem as in the picture above.
Non-VBA solutions preferred = )
Buddy, seems Non-VBA solution is still to be found, as solution lies on hiding the said row.
However if you are bent on finding non-vba solution then here is very crude solution -
suppose this is the data (C3:I15) with the helper columns which has been described below -
helper column (hC1) has formula
=IF(ISNUMBER(D4),1,"")
hC2 has formula
=IFERROR(E4*ROW(),"")
hC3 has formula
=SMALL($F$4:$F$15,ROW()-3)
X has formula
=IF(ISNUMBER(G4),INDEX(C4:C15,MATCH(G4,F4:F15,0)),"")
Y has formula
=VLOOKUP(H4,C4:D15,2,FALSE)
drag down all the formulas after entering into first rows....
Now you can plot chart from continuous data -

Ignore cells on Excel line graph

I am trying to draw a line graph in Excel 2010. The y column data source has some gaps in it and I want these to be ignored for the graph. Seems to default these to zero. I know the "Hidden and Empty Cell Settings" exists, but this is only giving the option to set it to zero. Any other way to get my graph looking the way I want it
Image available once I have enough reputation!
if the data is the result of a formula, then it will never be empty (even if you set it to ""), as having a formula is not the same as an empty cell
There are 2 methods, depending on how static the data is.
The easiest fix is to clear the cells that return empty strings, but that means you will have to fix things if data changes
the other fix involves a little editing of the formula, so instead of setting it equal to "", you set it equal to NA().
For example, if you have =IF(A1=0,"",B1/A1), you would change that to =IF(A1=0,NA(),B1/A1).
This will create the gaps you desire, and will also reflect updates to the data so you don't have to keep fixing it every time
In Excel 2007 you have the option to show empty cells as gaps, zero or connect data points with a line (I assume it's similar for Excel 2010):
If none of these are optimal and you have a "chunk" of data points (or even single ones) missing, you can group-and-hide them, which will remove them from the chart.
Before hiding:
After hiding:
In the value or values you want to separate, enter the =NA() formula. This will appear that the value is skipped but the preceding and following data points will be joined by the series line.
Enter the data you want to skip in the same location as the original (row or column) but add it as a new series. Add the new series to your chart.
Format the new data point to match the original series format (color, shape, etc.). It will appear as though the data point was just skipped in the original series but will still show on your chart if you want to label it or add a callout.
There are many cases in which gaps are desired in a chart.
I am currently trying to make a plot of flow rate in a heating system vs. the time of day. I have data for two months. I want to plot only vs. the time of day from 00:00 to 23:59, which causes lines to be drawn between 23:59 and 00:01 of the next day which extend across the chart and disturb the otherwise regular daily variation.
Using the NA() formula (in German NV()) causes Excel to ignore the cells, but instead the previous and following points are simply connected, which has the same problem with lines across the chart.
The only solution I have been able to find is to delete the formulas from the cells which should create the gaps.
Using an IF formula with "" as its value for the gaps makes Excel interpret the X-values as string labels (shudder) for the chart instead of numbers (and makes me swear about the people who wrote that requirement).
Not for blanks in the middle of a range, but this works for a complex chart from a start date until infinity (ie no need to adjust the chart's data source each time informatiom is added), without showing any lines for dates that have not yet been entered. As you add dates and data to the spreadsheet, the chart expands. Without it, the chart has a brain hemorrhage.
So, to count a complex range of conditions over an extended period of time but only if the date of the events is not blank :
=IF($B6<>"",(COUNTIF($O6:$O6,Q$5)),"") returns “#N/A” if there is no date in column B.
In other words, "count apples or oranges or whatever in column O (as determined by what is in Q5) but only if column B (the dates) is not blank". By returning “#N/A”, the chart will skip the "blank" rows (blank as in a zero value or rather "#N/A").
From that table of returned values you can make a chart from a date in the past to infinity

Resources