+ Reply to Thread
Results 1 to 8 of 8

Offset and Look value upside from ever changing last corresponding row

  1. #1
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2021
    Posts
    273

    Offset and Look value upside from ever changing last corresponding row

    Sample Workbook with data in version 97-2003 is attached for ready reference.

    I have worksheet where I keep data from Row 30 onwards and it keeps expanding.

    In order to see what is the last uniques record from Column B having DATE (dd-mmm-yy), I use following formula in Cell C10 to get the last date:

    Please Login or Register  to view this content.
    In Cell D10, I use following formula to get corresponding Row number to find what that last cell is:

    Please Login or Register  to view this content.
    Now, I want to retrieve certain values from Column L (data begins from row 30 onward, and will keep expanding along with new dates getting added in Column B).

    Since last date / transaction would appear at bottom, I want to scroll up, say 50 (control number, I have stores, to keep flexibility) in Cell F9, and G9.

    Now, I am confused, how to use OFFSET function (Or other combination, such that Cell F10 should show Max value, and G10 Min Value from Column L, with following rational.

    From Last date appearing in Cell B258 , formula should look through Column L UPWARD side to locate, Max / Min value from Control figure given in Cell F9 & G9.

    Currently, I have shown manually in Cell M257, N257 , Max and Min value starting from Row 258 and ignoring that cell, moving range up -50 row upside, Max and Min value.

    Last date / data / row will keep increasing day by day, and Control figure (currently 50) may also change to see the other relevant similar details.

    Thanks
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Offset and Look value upside from ever changing last corresponding row

    Your dates show no duplicates, is that co-incidence?

    if not, would you be open to using a helper column to give a unique value to each date? Something like =B31+COUNTIF($B$31:B31,B31)/100
    Then you could base your search on that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2021
    Posts
    273

    Re: Offset and Look value upside from ever changing last corresponding row

    There wont be any duplicates, All date will be unique in Column B.

    If nothing works, then, Helper column may be thought of.

    Issue in given circumstance is for OFFSET function- 'Reference' argument the cell that we refer is not static and will keep moving down which would be the last value in Column B and from there, upside nth value has to be retrieved, making use of Max/Min function.

    Thanks
    Last edited by analystbank; 08-02-2018 at 01:48 AM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Offset and Look value upside from ever changing last corresponding row

    This is what made me comment on that...
    In order to see what is the last uniques record from Column B having DATE (dd-mmm-yy),

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Offset and Look value upside from ever changing last corresponding row

    Try this, I think it does what you want. Although, from the looks of the highlighting in L, you are skipping the very last entry?
    =SUM(OFFSET($B$31,COUNTA(B:B)-2,10,-F9,1))
    =2018

    if you want to exclude the very last entry...
    =SUM(OFFSET($B$31,COUNTA(B:B)-3,10,-F9,1))
    =2006

  6. #6
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2021
    Posts
    273

    Re: Offset and Look value upside from ever changing last corresponding row

    Thanks Sir. Seems this works.

    You are right, I want to exclude very last entry, and for that reason making use of your suggestion as

    Please Login or Register  to view this content.
    What i observe, is that you are referring the Offset (reference) from Cell B1, which in my work model will be static and should not be a problem, but what
    Please Login or Register  to view this content.
    , as ROW reference does inside OFFSET formula? can you please briefly narrate, to enlighten me.


    Thanks again.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Offset and Look value upside from ever changing last corresponding row

    Sure. It was initially -2, 1 for the heading (countA counts everything), and then another 1 because I am actually starting 1 cell below the heading. Maybe this would have been easier to understand...
    =SUM(OFFSET($B$30,COUNTA(B:B)-1,10,-F9,1))

    Then to skip the last cell in the range...
    =SUM(OFFSET($B$30,COUNTA(B:B)-2,10,-F9,1))

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Offset and Look value upside from ever changing last corresponding row

    Thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help on using the offset function for monthly data changing yearly
    By DaySouth in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2016, 03:57 PM
  2. Changing time offset in Excel column
    By FlyerSG in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-06-2015, 05:14 PM
  3. drag offset formula with out changing values
    By cool_anu4u in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2013, 11:32 AM
  4. upside down
    By nirola in forum Excel General
    Replies: 9
    Last Post: 01-19-2010, 12:37 PM
  5. OFFSET problem: Changing dynamic chart
    By perra in forum Excel General
    Replies: 1
    Last Post: 02-06-2009, 05:57 AM
  6. Upside down text?
    By anwittin in forum Excel General
    Replies: 1
    Last Post: 09-18-2007, 05:47 PM
  7. [SOLVED] Use of offset and match functions with changing arrays, I think???
    By Prohock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 01:20 PM

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