Line Chart in excel with date times - excel

I'm trying to create a line chart in excel where the x axis is date time.
ie, the format is
But when I highlight the columns and click the line chart icon I get
Excel seems to insist on using only one of the dates and always puts the data series in the title.
This seems very strange to me.
What am I doing wrong here?

You should mark the complete range A and B and then press the button for adding a line chart.

I figured it out, excel was formatting my second column of numbers as text. So the graph was not generating.
I didn't notice it at first, but the column indentation indicates that those numbers are actually text fields.

Related

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

How to make an Excel line chart ignore certain cells?

I have monthly values in a column with cumulative values in the adjacent column. The cumulative calculation should only work where there is data for that month so I have used formulas such as =IF(E6>0,F5+E6,"")
I need a line chart showing the cumulative results but I don't want Excel to plot the cells containing "" Is this possible, using either chart options, or by changing the cumulative formula?
I've tried to post a picture of my chart but I'm new here so it won't allow me to. Let's see if it allows a link to mediafire instead.
In my picture (if you can see it) I want the red line for 2015 to stop at March, instead of plotting zeroes for the rest of the year.
Link to screenshot
One possible solution is to use:
=IF(E6>0,F5+E6,NA())
It will display #N/A instead of empty string. If it doesn't look OK, you could create a helper column with this formula, add it to chart, and hide this column.

Excel charts: prevent auto grouping of dates

I got an excel table with two columns: date (dd/mm/yyy hh:mm) and value (integers).
The table has about 8000 values in a time range of 4 days.
When I try to create a line or bar chart on these two columns, excel somehow accumulates all values for one day (ignoring the time). i.e. I get a bar chart with 4 bars.
What I actually want is having a bar/line chart where every single row resembles a bar/point in line chart. Where can I find the friggin option to tell Excel what I want?
INFO: I use MS Excel for Mac: 2011, but I am pretty sure this is not a version related issue, but rather a 8th layer problem ;)
When you create an axis that has time and date values, Excel tries to be helpful and guess what you are trying to do. I'm not sure about the mac, but in Excel 2010, when you right click the axis, and format it, this is the first window that pops up:
For the Axis Type (seen around the middle here) it has Automatically select based on data selected. This is what is grouping your data together as dates. Change it to a Text axis, and all the points on your graph should now appear.
You need to separate date from time.
Create a new column and copy your date/time field (via equation or copy/paste)
Format one column as a date and the other as time.
Now your chart shouldn't auto-group.
(I realize this question is old but maybe this will help someone else.)

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

Excel, giving data labels to only the top/bottom X% values

I have a simple line chart that I've added data labels to:
But I don't want all those labels. I only want the top and bottom 10% (arbitrary number) values to be shown. For example, in the picture I'd only want the labels for 51, 54, 57, 61, 66, 68, 74 to show. I can manually delete the other labels but the chart data changes dynamically over time. Is there a method for accomplishing this? The text in those labels is a placeholder right now and will eventually be 6-10 characters long, at which point having all those labels will just be a complete mess.
I'm not real confident in VBA so I'd only like to fall back on that as a last resort.
Edit: Thanks to Scott for his insightful answer. It works perfectly with a manually populated Data Labels column. However, some jury rigging is needed if one wants to populate it dynamically. I used the following formula to populate it:
=IF(OR(O1=LARGE($O$1:$O$30,1),O1=LARGE($O$1:$O$30,2),O1=LARGE($O$1:$O$30,3)),O1,"")
Basically, it copies cell values from column O to column P if the value in O is the top 1st, 2nd, or 3rd value in the list. If it's not any of those, it leaves the cell blank. But even if a cell is visually blank, Excel's charting functions interprets the value as 0 if there is a formula in the cell. This means the entire bottom of the graph has repeated data labels of "0%". To solve this I set the value of the FALSE parameter as a negative number and then changed the minimum value on the graph from automatic to 0. This leaves the unfit values below the bottom of the chart, out of visible range.
AHA!
Just when I thought there was no non-VBA solution other than picture links, my ingenuity came through :)
Here is what you can do, in stages:
1) Create a data set next to your original series column with only the values you want labels for (again, this can be formula driven to only select the top / bottom n values). See column D below.
2) Add this data series to the chart and show the data labels.
3) Set the line color to No Line, so that it does not appear!
4) Volia! See Below!

Resources