ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   merged cells and creating charts (https://www.excelbanter.com/charts-charting-excel/245001-merged-cells-creating-charts.html)

troubled excel user

merged cells and creating charts
 
I have tried to create a chart with data that is in merged cells where I have
put in a formula to calculate the average of 4 cells in the row above. When I
create the chart, it recognizes all 4 of the merged cells. So the graph has 4
spaces for the data for each number I am trying to plot. I just got 2007
version and do not recall this problem at all in 2003 version

ExcelBanter AI

Answer: merged cells and creating charts
 
Hi there! I can definitely help you with this issue.

When you have merged cells in your data, Excel treats them as a single cell, which can cause issues when creating charts. However, there is a workaround that you can use to plot your data correctly.

Here are the steps to follow:
  1. Unmerge the cells that contain your data. To do this, select the merged cells, right-click, and choose "Unmerge Cells" from the context menu.
  2. Copy the formula that calculates the average of the 4 cells in the row above.
  3. Select the first cell where you want to paste the formula and press Ctrl + Shift + Down Arrow to select all the cells in that column that contain data.
  4. Press Ctrl + 1 to open the Format Cells dialog box.
  5. In the Alignment tab, check the "Wrap text" checkbox and click OK.
  6. Paste the formula into the first cell and press Enter to apply it to all the selected cells.
  7. Now that your data is no longer merged, you can create your chart as usual. Select the data range, including the column with the averages, and choose the chart type you want to use.
  8. Once the chart is created, you can format it to your liking, including adding axis labels, titles, and legends.

I hope this helps you create your chart successfully!

Bernard Liengme[_3_]

merged cells and creating charts
 
Merged cells are to be avoided at all costs.
They can be used for column heading but for little else.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Troubled excel user" <Troubled excel wrote
in message ...
I have tried to create a chart with data that is in merged cells where I
have
put in a formula to calculate the average of 4 cells in the row above.
When I
create the chart, it recognizes all 4 of the merged cells. So the graph
has 4
spaces for the data for each number I am trying to plot. I just got 2007
version and do not recall this problem at all in 2003 version




David Biddulph[_2_]

merged cells and creating charts
 
I'd be willing to guess that Excel 2003 would have behaved the same.
Thank you for adding yet another example to the countless demonstrations
(listed in the archives of these Excel newsgroups) of why merged cells
should be avoided like the plague.
We keep advising people, but they keep shooting themselves in the foot by
using merged cells when there are usually much better alternatives (such as
the alignment option to "Center across selection").
--
David Biddulph

"Troubled excel user" <Troubled excel wrote
in message ...
I have tried to create a chart with data that is in merged cells where I
have
put in a formula to calculate the average of 4 cells in the row above.
When I
create the chart, it recognizes all 4 of the merged cells. So the graph
has 4
spaces for the data for each number I am trying to plot. I just got 2007
version and do not recall this problem at all in 2003 version




Jon Peltier[_2_]

merged cells and creating charts
 
The online help should say in size 16 type:

DON'T USE MERGED CELLS

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



David Biddulph wrote:
I'd be willing to guess that Excel 2003 would have behaved the same.
Thank you for adding yet another example to the countless demonstrations
(listed in the archives of these Excel newsgroups) of why merged cells
should be avoided like the plague.
We keep advising people, but they keep shooting themselves in the foot by
using merged cells when there are usually much better alternatives (such as
the alignment option to "Center across selection").
--
David Biddulph

"Troubled excel user" <Troubled excel wrote
in message ...
I have tried to create a chart with data that is in merged cells where I
have
put in a formula to calculate the average of 4 cells in the row above.
When I
create the chart, it recognizes all 4 of the merged cells. So the graph
has 4
spaces for the data for each number I am trying to plot. I just got 2007
version and do not recall this problem at all in 2003 version




Sean Mulvihill

Create Excel chart from merged cells
 
I was looking for an answer to creating a chart from merged cells. After searching and not finding an answer I came across the Union method.

This sub creates a chart for a series of two merged cells expanding across the whole worksheet apart for the first two cells

Sub subCreateChart()
'This sub creates a chart for merged cells taking the information from the cell listed
'eg the two merged cells C37 and D37 the Excel address is C37 that holds the data.
Dim rngAvg As Range
Dim rngTemp As Range
Dim i As Integer

For i = 3 To 253 Step 2

Set rngTemp = Range(Cells(37, i), Cells(39, i)) 'Set the first and subsequent merged cells as a range.
If i = 3 Then
Set rngAvg = rngTemp 'set the first selected range to an accumulating range
Else
Set rngAvg = Union(rngAvg, rngTemp) 'after the first range has been assigned to rngAvg
'add all over ranges by looping through the required data.
End If
Next i

Charts.Add
ActiveChart.ChartType = xlLine

ActiveChart.SetSourceData rngAvg, PlotBy:=xlRows 'when collection is complete use the accuumulated
'range to create chart.
ActiveChart.DisplayBlanksAs = Excel.XlDisplayBlanksAs.xlInterpolated
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub




Bernard Liengme wrote:

Merged cells are to be avoided at all costs.
08-Oct-09

Merged cells are to be avoided at all costs.
They can be used for column heading but for little else.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

Previous Posts In This Thread:

On Thursday, October 08, 2009 12:34 PM
Troubled excel user wrote:

merged cells and creating charts
I have tried to create a chart with data that is in merged cells where I have
put in a formula to calculate the average of 4 cells in the row above. When I
create the chart, it recognizes all 4 of the merged cells. So the graph has 4
spaces for the data for each number I am trying to plot. I just got 2007
version and do not recall this problem at all in 2003 version

On Thursday, October 08, 2009 12:39 PM
Bernard Liengme wrote:

Merged cells are to be avoided at all costs.
Merged cells are to be avoided at all costs.
They can be used for column heading but for little else.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

On Thursday, October 08, 2009 12:53 PM
David Biddulph wrote:

I'd be willing to guess that Excel 2003 would have behaved the same.
I'd be willing to guess that Excel 2003 would have behaved the same.
Thank you for adding yet another example to the countless demonstrations
(listed in the archives of these Excel newsgroups) of why merged cells
should be avoided like the plague.
We keep advising people, but they keep shooting themselves in the foot by
using merged cells when there are usually much better alternatives (such as
the alignment option to "Center across selection").
--
David Biddulph

On Thursday, October 08, 2009 3:24 PM
Jon Peltier wrote:

The online help should say in size 16 type:DON'T USE MERGED CELLS-
The online help should say in size 16 type:

DON'T USE MERGED CELLS

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



David Biddulph wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
WMI - VB 6.0 Windows Management Instrumentation
http://www.eggheadcafe.com/tutorials...dows-mana.aspx


All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com