+ Reply to Thread
Results 1 to 7 of 7

Random selecting a row of cells

  1. #1
    Registered User
    Join Date
    11-08-2010
    Location
    Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    4

    Random selecting a row of cells

    Hello,

    For my Master thesis I have to simulate stock portfolios. In my database the rows stand for different assets and the collums for the returns in different years. Now I want to simulate a random portfolio and calculate the volatility of this portfolio. The first step in this is to select a row randomly, although I found out how to select a random cell in a specific area, I am not able to select a random row. Has somebody an idea how I can do this?

    Gr nedvim100

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,644

    Re: Random selecting a row of cells

    maybe something like this:

    =INDEX(A1:C12, RANDBETWEEN(1,12), RANDBETWEEN(1,3))

    Take care about ranges.

  3. #3
    Registered User
    Join Date
    11-08-2010
    Location
    Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Random selecting a row of cells

    Thanks zbor, but I want to select a row of numbers so for example in an index A1:O80 I want to select a random row and use Ax:Ox for further calculations although I'm not sure that excel is able to do this.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,644

    Re: Random selecting a row of cells

    Can you post an example with input and desired output?

  5. #5
    Registered User
    Join Date
    11-08-2010
    Location
    Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Random selecting a row of cells

    In the file you see a part of the datafile I use and a description about the calculations I want to make.
    Attached Files Attached Files

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,644

    Re: Random selecting a row of cells

    Assets can be randomly taken from 1 to 630 without repeating?

  7. #7
    Registered User
    Join Date
    11-08-2010
    Location
    Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Random selecting a row of cells

    I want to select the complete row of numbers. So with the formula I select a row for example row 12 (the row is a single asset with the yearly returns of this assets for 15 years) and than again a random row for example row 20. Than for every year (collom) the average return of this two assets has to be calculated which finally results in a row of 15 numbers with the average returns of this random selected assets portfolio. The last step is calculating the standard deviation of this sequence of numbers to determine the risk of this virtual portfolio.

+ 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