+ Reply to Thread
Results 1 to 5 of 5

Dynamic cell reference

  1. #1
    Registered User
    Join Date
    07-23-2010
    Location
    Brighton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Dynamic cell reference

    I have a dynamic fomula that tells me the row number of my final data entry on 'PAGE1'
    (=MATCH(9.999999E+306,'PAGE1'!B:B))

    from this i have the row numbers of several colums ie. the last 3 row numbers
    =MATCH(9.999999E+306,'SIM1'!B:B)-2 = 169189
    =MATCH(9.999999E+306,'SIM1'!B:B)-1 = 169190
    =MATCH(9.999999E+306,'SIM1'!B:B) = 169191

    is there a way i can use this number in a formula. I need to look for example on PAGE1 in cell B169191. Normally this formula would be ='PAGE1'!B169191 however it would need me to manually type in this value.

    Is there a way i can set a formula to select cell 'B' then my dynamic number automatically?

    In my example (see attachment) the formula in cell B7 would need to be ='PAGE1'!B169189 (with value 169189 taken from D7)

    Every file i load will be of a different lenght.

    any ideas?
    Attached Images Attached Images

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Dynamic cell reference

    Yes, there is. Use the Match() part you've already established to figure out the row number and insert it into the INDEX() function.

    =INDEX('PAGE1'!B:B,MATCH(9.999999E+306,'PAGE1'!B:B,1))


    Personally, I prefer 99^99 as the VERY BIG NUMBER for Match. I've never come across a situation where it was too small, and it's easier to write in a formula:


    =INDEX('PAGE1'!B:B,MATCH(99^99,'PAGE1'!B:B,1))
    Last edited by teylyn; 08-13-2010 at 08:17 AM.

  3. #3
    Registered User
    Join Date
    07-23-2010
    Location
    Brighton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Dynamic cell reference

    Thanks teylyn for data on the bottom row this has worked a treat!

    still having some problems making this formula look at the value of a cell one or two rows from the bottom though can't seem to make it work.

    It seems as though this formula only works for numbers, is there an adaption that can be used for text?

    I've attached another image showing the problem.

    all my import files have the times in the format '36s' which is a text string so excel doesn't like it using this formula

    NOTE: just noticed a small mistake on IMG_2.jpg the bottom right image should have '36s' and '60s' rather than '36' and '60'

    SUCESS: this seems to work
    INDEX(LOG_DATA!F:F,MAX(MATCH(99^99,LOG_DATA!F:F),MATCH(REPT("z",255),LOG_DATA!F:F)-3))
    Attached Images Attached Images
    Last edited by jamie.finney; 08-13-2010 at 12:25 PM.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Dynamic cell reference

    Jamie, post a workbook, not a picture, please.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Dynamic cell reference

    Quote Originally Posted by jamie.finney
    is there an adaption that can be used for text?
    REPT("Z",255) will normally suffice for strings

    For more info. on formulae for determining last values see: http://www.xldynamic.com/source/xld.LastValue.html

+ 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