Home > Software engineering >  How to make a graph of a sum of a series of numbers?
How to make a graph of a sum of a series of numbers?

Time:12-03

I would like to make a graph that tracks the sum of a series of numbers. For example if I have the cells

| 5 |

| -3 |

| 8 |

| 7 |

| -4 |

I would like a graph that follows 5, 2, 10, 17, 13. How do I do this please? Thank you in advance

CodePudding user response:

you can try adding a new column with the following formula for graph purposes.

=ARRAY_CONSTRAIN(SCAN(,A:A,LAMBDA(ini,ax,ax ini)),ROW(LOOKUP(2^99, A:A)),1)

  • Column A has raw data and cell B1 accommodates the formula.

enter image description here

CodePudding user response:

To create a graph in Google Sheets that tracks the sum of a series of numbers, you can use the SUM function in combination with the OFFSET function to create a dynamic range for the data in your graph. Here's an example of how you can do this:

  1. Enter the numbers in your series in a column in your sheet, with each number in its own cell. For example, you could enter the numbers in cells A1, A2, A3, and so on.

  2. In the cell below the last number in your series, enter the formula =SUM(A1:A5) to calculate the sum of the numbers in your series.

  3. Select the cell containing the sum, and then click on the Insert tab in the top menu.

  4. In the Insert tab, click on the Chart option to open the chart editor.

  5. In the chart editor, select the Line chart type and click on the Next button.

  6. In the next screen, select the dynamic range option and enter the formula =OFFSET(A1,0,0,COUNTA(A:A)) in the range field. This will create a dynamic range that includes all the cells in column A that contain numbers, so that your graph will automatically update as you add more numbers to your series.

  7. Click on the Save button to save your graph, and then click on the Insert button to insert it into your sheet.

Your graph should now show the sum of your series of numbers, with each point on the graph representing the sum of all the numbers up to that point. For example, the first point on the graph would represent the sum of the first number in your series, the second point would represent the sum of the first and second numbers, and so on.

  • Related