+ Reply to Thread
Results 1 to 19 of 19

why do i get "range out of bounds"

  1. #1
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    why do i get "range out of bounds"

    why do i get "range out of bounds" for v(i) = x(i) * y(i)?


    Please Login or Register  to view this content.
    Last edited by Cutter; 07-24-2012 at 07:54 PM. Reason: Added code tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: why do i get "range out of bounds"

    What is "size"?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    size is 1000 data values. i want to loop through using range of 50 points

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: why do i get "range out of bounds"

    Is that a function you're written? A public array? Something else?

    What's the size of the array (look in the Locals window) after the line executes?

    What are the dimensions of x and y? How are they passed?

  5. #5
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    Please Login or Register  to view this content.
    Last edited by Cutter; 07-24-2012 at 07:55 PM. Reason: Added code tags

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: why do i get "range out of bounds"

    is the lower bound of x zero?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: why do i get "range out of bounds"

    We can look at your code, or look at your problem.

    Regarding your problem, you didn't answer my question about the array dimensions when the subscript error occurs.

    Regarding your code, what does it do for OLS regression that you couldn't do in a few lines using LinEst?

    Please Login or Register  to view this content.
    Last edited by shg; 07-24-2012 at 06:05 PM.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: why do i get "range out of bounds"

    @ blw2002

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  9. #9
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    Quote Originally Posted by JosephP View Post
    is the lower bound of x zero?
    yes. thanks for help

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: why do i get "range out of bounds"

    that's the problem then. you're trying to refer to v(0) but v is using base 1 so there is no v(0). you could use v(i + 1) or be consistent and base everything at 0

  11. #11
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    I am still getting v(i) = x(i) * y(i) is out of range. Here is the full code. Any thoughts?


    Please Login or Register  to view this content.
    Last edited by Cutter; 07-25-2012 at 08:19 PM. Reason: Added code tags

  12. #12
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: why do i get "range out of bounds"

    same reason.

  13. #13
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    what do i change exactly?

  14. #14
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: why do i get "range out of bounds"

    you need to redim v to the same dimensions as x
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    it's not working. did you try?

  16. #16
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: why do i get "range out of bounds"

    not working in what way?

  17. #17
    Registered User
    Join Date
    07-18-2012
    Location
    ny, ny
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: why do i get "range out of bounds"

    i still get the same "subscript out of range" for v

  18. #18
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: why do i get "range out of bounds"

    Post the code with the error, please.
    Remember what the dormouse said
    Feed your head

  19. #19
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: why do i get "range out of bounds"

    blw2002

    When you post your code, as requested by romperstomper, please add code tags. I brought that rule to your attention in post #8. In post #11 you failed to apply the tags so, once again, I added them for you.

+ 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