+ Reply to Thread
Results 1 to 4 of 4

How to reference to top row of filtered data / then formula to reference the second row...

  1. #1
    Forum Contributor
    Join Date
    02-09-2016
    Location
    West Midlands
    MS-Off Ver
    2016
    Posts
    224

    Post How to reference to top row of filtered data / then formula to reference the second row...

    Hi Guys!

    This question was posted and is similar to what i was after,

    I am using filters and want to return the value from the top row of the filtered data into another cell. I can't reference to the top row, as when the rows hide when I use another filter, it returns the incorrect value. I'm sure this has a simple solution - I just can't think it!


    Answer which works for me,

    Hi,



    Say your filtered range is A1:A20 with a header in A1. This ARRAY formula returns the top visible row below the header



    =INDIRECT("A"&MIN(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A20)-ROW(A2),,1)),ROW(A2:A20))))



    To Adapt this you will need to change the column; the first A, and the range. With the range remember it doesn't include the cell with the filter arrow in.



    This is an array formula which must be entered by pressing CTRL+Shift+Enter
    and not just Enter. If you do it correctly then Excel will put curly brackets
    around the formula {}. You can't type these yourself. If you edit the formula
    you must enter it again with CTRL+Shift+Enter.


    I now need the formula to return the Second Row down not the first.

    How do i achieve this? I have tried altering the Parameters within the Code but alas... nothing
    Last edited by Ourkid123uk; 04-17-2017 at 02:25 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: How to reference to top row of filtered data / then formula to reference the second ro

    Try this.
    =INDIRECT("A"&SMALL(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A20)-ROW(A2),,1)),ROW(A2:A20)),2))

    Confirmed as array.

  3. #3
    Forum Contributor
    Join Date
    02-09-2016
    Location
    West Midlands
    MS-Off Ver
    2016
    Posts
    224

    Re: How to reference to top row of filtered data / then formula to reference the second ro

    You guys are good! Feedback left, thank you SO much

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: How to reference to top row of filtered data / then formula to reference the second ro

    You are welcome and thanks for the rep

+ 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. [SOLVED] Replace a cell reference in a formula with dynamic reference
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2016, 11:04 AM
  2. [SOLVED] Locked formula changes reference when rows added to reference sheet in same workbook
    By macrorookie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2014, 04:08 PM
  3. VLookup changes reference row when source data is filtered
    By ilantia in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-14-2013, 10:09 PM
  4. Dragging formula, change sheet reference, but not cell reference
    By Kalilaya0419 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-13-2013, 04:50 PM
  5. Replies: 5
    Last Post: 09-21-2012, 02:08 PM
  6. Display data reference from another worksheet based on cell reference
    By Drew123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2011, 03:52 PM
  7. Replies: 7
    Last Post: 06-20-2008, 02:54 AM

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