+ Reply to Thread
Results 1 to 3 of 3

Create a list of the sum of random numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Portland, OR
    MS-Off Ver
    Excel 2008
    Posts
    3

    Create a list of the sum of random numbers

    I have a spreadsheet that contains a list of 5 random numbers (i.e. A1=RANDBETWEEN(1,10), A2=RANDBETWEEN(1,10), etc). At the bottom I have the sum of those random numbers (i.e. =SUM(A1:A5). This sum changes every time that I update the spreadsheet or hit "calculate." This is not the issue, as I want the random numbers to change.

    My goal is to create a list of the sums of random numbers. (i.e. if the first set of random numbers were 1,1,1,1,1 then I would want to record the sum--5--in a cell. If, the next time I hit calculate, the set of random numbers became 2,2,2,2,2, then I want want to record the sum--10--in a cell directly below the previous sum--5--and have this continue every time the random numbers update/every time I hit calculate). Is this a possibility? Is it something that I would have to use VBA for?

    Thanks.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Create a list of the sum of random numbers

    No possibility using formulas. Only using Copy>>paste special>only values>>Eatch Time.

    Probably using VBA.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: Create a list of the sum of random numbers

    You try this vba.
    Private Sub WorkSheet_Calculate()
    Application.EnableEvents = False
        Sheets("Sheet1").Range("A65536").End(xlUp).Select
        RowNum = ActiveCell.Row + 1
        Cells(RowNum, 1) = Worksheetfunction.sum(Range("A1:A5"))
        Application.EnableEvents = True
    End sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1