+ Reply to Thread
Results 1 to 15 of 15

copying exact position in sheet that have filtered data

Hybrid View

  1. #1
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    copying exact position in sheet that have filtered data

    Hi,

    I need to solve something that look to me like easy thing, but so far after 5 hours of google and youtube searching i still can't find solution.
    Here is the thing. I have table with lot of filtered data, but the solution i need can be found inside single column...

    Lets say i have base of thousand companies and they start from field D4. In D3 we have filter "company name". What i want is to copy into cell D1 name of company that i have in D4 after i use filter. So i need copy position cell, 4th cell on the table, no matter which row it is after filter.
    I hope you do understand my problem. I am not power user, but i know how to use things once i see examples, so i learnt to use subtotal, offset and such things, but problem here is that i need to copy, hm, text.

    thx in advance, d

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: copying exact position in sheet that have filtered data

    Using an extra column, assuming column E is empty (otherwise, use an available column, changing any references to column E in the formulas to the column that you use).

    In E4, enter the formula,

    =SUBTOTAL(3,D4)

    And use autofill to copy it down to the end of your table.

    Then in D1, enter the formula

    =INDEX(D:D,MATCH(1,E:E,0))

    Does that do what you need?

  3. #3
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    yet not sure why this work, but it works. Thx a lot jason

  4. #4
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    Quote Originally Posted by jason.b75 View Post
    Using an extra column, assuming column E is empty (otherwise, use an available column, changing any references to column E in the formulas to the column that you use).

    In E4, enter the formula,

    =SUBTOTAL(3,D4)

    And use autofill to copy it down to the end of your table.

    Then in D1, enter the formula

    =INDEX(D:D,MATCH(1,E:E,0))

    Does that do what you need?
    After all examination this formula seems to be a bit better for one reason.. The one that Tony gave takes enormous resources for calculation, while this one does it instantly... But as always, there is a but...
    why this formula always leave in filter last row, no mattter that is different company in my particular case? Is it avoidable?

  5. #5
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    Quote Originally Posted by jason.b75 View Post
    Using an extra column, assuming column E is empty (otherwise, use an available column, changing any references to column E in the formulas to the column that you use).

    In E4, enter the formula,

    =SUBTOTAL(3,D4)

    And use autofill to copy it down to the end of your table.

    Then in D1, enter the formula

    =INDEX(D:D,MATCH(1,E:E,0))

    Does that do what you need?
    After all examination this formula seems to be a bit better for one reason.. The one that Tony gave takes enormous resources for calculation, while this one does it instantly... But as always, there is a but...
    why this formula always leave in filter last row, no mattter that is different company in my particular case? Is it avoidable?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: copying exact position in sheet that have filtered data

    If I understand what you want this formula will return the 4th entry from a filtered list.

    =INDEX(D4:D100,MATCH(4,SUBTOTAL(3,OFFSET(D4:D100,,,ROW(D4:D100)-ROW(D4)+1)),0))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    nope, i need 1st one data after applying filter. in my table it is D4. so i need data that is in d column, on 4th position from top. it doesnt matter if it is row178, i just need visually 4th place. and i need to place result in D1 field.. latter i will use vlookup for that D1, but that doesnt matter at this post

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: copying exact position in sheet that have filtered data

    Try Tony's formula, changing the lookup value of match from 4 to 1, i.e.

    =INDEX(D4:D100,MATCH(1,SUBTOTAL(3,OFFSET(D4:D100,,,ROW(D4:D100)-ROW(D4)+1)),0))

    Does that work?

  9. #9
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    Quote Originally Posted by jason.b75 View Post
    Try Tony's formula, changing the lookup value of match from 4 to 1, i.e.

    =INDEX(D4:D100,MATCH(1,SUBTOTAL(3,OFFSET(D4:D100,,,ROW(D4:D100)-ROW(D4)+1)),0))

    Does that work?
    Nope, this doesn't work either. But like i said, i am satisfied with extra column solution.

  10. #10
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: copying exact position in sheet that have filtered data

    Subtotal ignores rows hidden by a filter, so in both methods, the hidden rows will return a zero value to the subtotal function, match looks for the first row with a subtotal value of 1 (first visible row).

    Tony's method is more versatile than mine, in that it could return any visible row simply by changing the lookup value.

    edit:-

    I ran a test on Tony's method and it appeared to work as expected once the value was changed to 1.

    Filtered data so that rows 4:15 were hidden and formula returned data from D16.
    Last edited by jason.b75; 06-01-2016 at 09:37 AM.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: copying exact position in sheet that have filtered data


  12. #12
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    sorry, although u politely write me rule for array formulas, i forgot to press shift ctrl. formula works perfectly after small change that jason pointed out.

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: copying exact position in sheet that have filtered data

    Good deal. Thanks for the feedback!

  14. #14
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: copying exact position in sheet that have filtered data

    I've used subtotal with filtered rows for similar purposes before, but not noticed that happen until now, maybe a problem that only occurs with newer versions of excel.

    I tried a different function which appears to work correctly, try this in place of subtotal.

    =AGGREGATE(3,5,D4)

  15. #15
    Registered User
    Join Date
    06-01-2016
    Location
    Croatia
    MS-Off Ver
    2016 home and business
    Posts
    8

    Re: copying exact position in sheet that have filtered data

    Quote Originally Posted by jason.b75 View Post
    I've used subtotal with filtered rows for similar purposes before, but not noticed that happen until now, maybe a problem that only occurs with newer versions of excel.

    I tried a different function which appears to work correctly, try this in place of subtotal.

    =AGGREGATE(3,5,D4)
    if u ever come to croatia, feel free to contact me, i ll be your guide for free, like you guide me through excel.
    cheers,

    d

+ 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. Replies: 4
    Last Post: 04-06-2016, 07:06 AM
  2. Replies: 0
    Last Post: 07-10-2013, 04:49 PM
  3. copying filtered data from one sheet to another automatically
    By hnnn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2010, 10:36 AM
  4. link to copying data(filtered) into another sheet using macro
    By sameerk0286 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-10-2010, 09:32 PM
  5. Copying "filtered" data to another sheet
    By aussie89 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-27-2010, 09:45 AM
  6. [SOLVED] Trasnsposing or copying filtered data from one sheet to another
    By Sierras in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-14-2006, 01:30 PM
  7. Know exact position of a cell in the Sheet
    By baldomero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2005, 02:45 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