[Solved] Set chart Data Rages from cell value

Discuss the spreadsheet application
Locked
giavvns
Posts: 19
Joined: Thu Feb 25, 2010 8:38 pm

[Solved] Set chart Data Rages from cell value

Post by giavvns »

I need to do a graph over a range of cells, say, $A$1:$A$20. The cell number 20 always varies and it's been determined by another function. I usually go and manualy change the number 20 to whatever number the function outputs. How can I do that automatically? In other words how cai I have something like this:

$A$1:$A$$NUM, where NUM=20?

Thanks
Last edited by MrProgrammer on Tue Mar 26, 2024 6:24 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 4 on SuSE opensuse-lean 15.0
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Change range of cells automatically

Post by Villeroy »

Tools>Options>Calc>"Expand references when rows/columns are inserted " = ON

Now you can insert new cells anywhere within or directly below the referenced range and all references in formulas, names, charts, conditional formatting etc. will expand automatically.

With that setting turned off, only insertions between the second and the last row/column will expand references. Insertions on top will shift ther references and insertions directly below have no effect.

The same setting applies to columns likewise.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
MrProgrammer
Moderator
Posts: 4909
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Change range of cells automatically

Post by MrProgrammer »

giavvns wrote: Tue Mar 19, 2024 9:32 am In other words how cai I have something like this: $A$1:$A$$NUM, where NUM=20?
You cannnot use constructs like $A$1:$A$$cell or INDIRECT(cell) in Format → Data Ranges for a chart. Data Ranges only support fixed cell ranges. However you can supply a large chart range like $A$1:$A$999. Unused cells at the end of the range are ignored by the chart. As you use more of the cells, the chart adjusts automatically.

If you need any additional assistance attach a spreadsheet demonstrating the situation (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the spreadsheet itself). I will not help further unless you attach a spreadsheet.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked