Closed Thread
Results 1 to 12 of 12

why wont INDEX work without $??

Hybrid View

  1. #1
    colwyn
    Guest

    why wont INDEX work without $??

    s/s is 325501 rows deep and I run the following macro down column M.

    =IF(L100001>0,INDEX(J$1:J100000,L100001,1),"")
    Thing is, I don't want INDEX to look back more than 100,000 rows.
    However, when from row 100,000 I delete the $ sign the macro produces #ref! in some cells and 0.00 in others. I cannot work this out and wonder if anyone has a solution?
    Big thanks.
    Colwyn.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: why wont INDEX work without $??

    At row 1000, you would change the formula to, I think:

    =IF(L100001>0,INDEX(J$100000:J100001,L100001,1),"")

    and copy down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    colwyn
    Guest

    Re: why wont INDEX work without $??

    Apologies NBVC, true to form I didn't explain myself correctly.

    The macro starts at M3 with:
    =IF(L3>0,INDEX(J$1:J2,L3,1),"")
    At M100001 it is:
    =IF(L100001>0,INDEX(J$1:J100000,L100001,1),"")
    It's at this point that I need to restrict the formula to the past 100,000 rows.
    However, when from row 100,000 I delete the $ sign the macro produces #ref! in some cells and 0.00 in others. I cannot work this out and wonder if you or anyone else has a solution?
    Big thanks.
    Colwyn.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: why wont INDEX work without $??

    Revise the formula at M10001 to

    =IF(L100001>0,INDEX(J$99999:J100000,L100001,1),"")

    and copy down

  5. #5
    colwyn
    Guest

    Re: why wont INDEX work without $??

    NBVC - I don't want to restrict the formula to row 100,000.
    I want the formula to always take into account the previous 100,000 rows.
    Big thanks.
    Colwyn.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: why wont INDEX work without $??

    Try then in first cell:

    =IF(L3>0,INDEX(INDEX(J:J,IF(ROW()>100000,ROW()-100000,ROW())):J2,L3,1),"")

    copied down.

  7. #7
    colwyn
    Guest

    Re: why wont INDEX work without $??

    NBVC - thanks again but it doesn't work.
    At row 100,001 and beyond it works fine but at rows 3 :100,000 it produces #REF! with the tag "Invalid Cell Reference Error"
    Maybe it isn't possible to achieve ??
    Big thanks
    Colwyn..

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

    Re: why wont INDEX work without $??

    At row 100001 and below, you want the start cell of the range (which is J1 through row 100000) to start incrementing down (J2, J3, ...)?
    Last edited by shg; 03-02-2009 at 08:19 PM.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: why wont INDEX work without $??

    Mine will give REF error for the same reason as daddylonglegs describes... It depends on what is in L3.

    If your putting the initial formula in Row 1, then L3 must be at most 2... if it is 3 or more you will get that error, because the index range produced by the formula is only 2 rows tall and so it won't find a row 3 (if L3=3, the row number you want in your formula).
    Last edited by NBVC; 03-02-2009 at 10:16 PM.

  10. #10
    colwyn
    Guest

    Re: why wont INDEX work without $??

    NBVC and daddylonglegs - looks like I've hit a brick wall.
    Once below row 100,000 the formula in column M will increasingly refer to rows below 100,000 and this seems to be presenting an insurmountable stumbling block.

    Shg - yes, at row 100001 and below, I want the start cell of the range (which is J1 through row 100000) to start incrementing down (J2, J3, ...). Any ideas ??

    Apologies to anyone having spent time wasted on this problem. It's only because I couldn't solve it that I posted it.
    Big thanks.
    Colwyn.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: why wont INDEX work without $??

    Maybe posting a sample worksheet of what you have showing your expectations would help?

Closed 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