+ Reply to Thread
Results 1 to 3 of 3

variable range with STDEV

  1. #1
    Registered User
    Join Date
    06-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    64

    variable range with STDEV

    So I don't have much for code to supply that will help you but I'll give you the code anyways.

    My problem is just to do with one line -- in the line I'm trying to set a cell equal to the standard deviation of a variable range.

    I need the cell to end up being a cell-reference formula so I can copy and paste it to calculate the standard deviation of many different ranges.

    Goal:
    set the activecell equal to the standard deviation of the range Start (my variable range) to Start.offset(vlookback * 20, 0)
    However, it needs to show up in the cell as something like "STDEV(B3:B23)" so when I copy that cell and paste it across the range(B3:G90) it will match the destination formatting.

    This is largely just a syntax error, thanks for the help.

    These were the two ways I already tried, it's a bit messy -- I'm pretty new to this haha. Thanks again. Let me know if you have any questions.

    'ActiveCell.FormulaR1C1 = "=STDEV(R[-" & vlookback & "]C[-" & n & "-1] : RC[-" & n & "-1])"
    ActiveCell.Value = "=STDEV(" & start & ": " & start.Offset(vlookback * 20, 0) & ")"

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: variable range with STDEV

    You can use something along the lines of:
    Please Login or Register  to view this content.
    To get =STDEV(B3:B23) in a cell.

    I'm not sure I understand your code 100% but I think for what you want it would be:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    64

    Re: variable range with STDEV

    What you suggested worked flawlessly, and you taught me something new too! I've never seen the replace thing, that's really useful! Thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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