Question

my problem is:

I have a matrix in excel then a function (repeated N times) that extract from this matrix a random number. This happen everytime i hit F9 or everytime something change in the sheet. After this i have another cell with a sum of all then numbers extracted. I would like to keep track of the change of this last cell in a linear chart to see how it goes on.

Thank you so much in advance

Was it helpful?

Solution

Solution 1: formulas

if you want to repeat T times, just instead of only 1 series of N number create a matrix of N by T. Then ad 1 last row (or column) under (or next to) the N functions for all T which contains the sum.

Now relate a chart to this last row (or column).

Solution 2: VBA

Create a piece of code that loops T times and copies the value of the cell with the sum into the next empty cell in a designate part of your excel workbook.

    Sub aaa
      dim i as Long
      dim T as Long

      T = 1000

      For i = 1 to T
        Range("rSum").Copy
        Cells(rows.count,1).offset(xlUp)).Offset(1, 0).PasteSpecial Paste:=xlPasteValues

      Next i
    End Sub
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top