Charting with dynamic data range

Berrett

Board Regular
Joined
Aug 6, 2004
Messages
249
I know this has been asked before but I've read the responses and I just can't seem to get it to work.

I have the following data:

Y Values: C7:C57
X Values: B7:B57

However, I need the user to be able to set the number of rows that are charted. For example, if the user typed in B1 that they wanted to chart 5 rows of data then I would want the chart reference to dynamically change to:

Y Values: C7:C11
X Values: B7:B11

I've googled it and it looks like I need to name ranges and use an indirect and/or an offset formula, but my Data Source chart dialogue box will not allow either to be entered into the Y Values or the Category (X) Axis Labels cells.

How can I pull this off?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Thanks for the reply. This seems like it should work, but it doesn't for me. Let me mention that a lot of my end users have Excel 2008 for Mac, meaning I can't use VBA.

Here are the named ranges I've trying to make work:

xvalues: OFFSET(Data_H!$B$7,Data_H!$G$7-1,0,Data_H!$G$8,1)
yvalues: OFFSET('data_h'!xvalues,0,1)

The yvalues named range won't even stick - the 'data_h' changed to the name of the workbook as soon as I click "Add".

But ultimately the problem is that I click "OK" and it tells me that the formula I've entered contains an error.

I know this can be done. Any other suggestions?
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top