+ Reply to Thread
Results 1 to 7 of 7

Filter without use of array?

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Filter without use of array?

    Hi,

    I have an example (attached) Whereby a formula can filter out gaps in the data to consolidate them in another column.

    The formula works by use of an array, and is pulled down

    {=IFERROR(INDEX($A$5:$A$991, MATCH(0, COUNTIF($B$4:B4,$A$5:$A$991), 0)),"")}

    I got this array formula by your good selves on this website. Unfortunately I use this too much and on a data set that's too large which has slowed by spreadsheet down. Is it possible to do the same thing without an array? I don't mind the use of helper columns etc, just need to get my spreadsheet working a little quicker

    Recently upgraded from 2007 to 365 so any tips on what the new version does would also be appreciated

    Best
    Sean
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Filter without use of array?

    You can use column B as a helper, with this formula in B5:

    =IF(A5="","-",MAX(B$4:B4)+1)

    Copy this down as far as you like. Then you can use this formula in C5:

    =IFERROR(INDEX(A:A,MATCH(ROWS($1:1),B:B,0)),"")

    Copy down until you get blanks.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Filter without use of array?

    MY MAN!!!!!!!!

    Thank you so much!!

  4. #4
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Filter without use of array?

    On small issue,

    What if there are repeats? Can it account for that?

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Filter without use of array?

    Do you not want to get repeats? i.e. you want a unique list? If so, use this in B5:

    =IF(A5="","-",IF(COUNTIF(A$5:A5,A5)=1,MAX(B$4:B4)+1,"-"))

    then copy down.

    Hope this helps.

    Pete

  6. #6
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Filter without use of array?

    You are a genius

    Thank you Pete

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Filter without use of array?

    You're welcome - thanks for the rep.

    Strictly speaking, you don't need the hyphens in the formula in column B, and could just have "" (twice), but I like to see where a formula is active.

    Pete

+ 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. Filter in array 2D
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2017, 04:05 PM
  2. [SOLVED] filter date in array vba
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-26-2017, 04:38 AM
  3. Array VBA Filter
    By rbirch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2016, 09:20 PM
  4. Replies: 6
    Last Post: 05-26-2012, 04:56 AM
  5. filter out the array
    By kaffal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2009, 02:06 PM
  6. Filter an Array
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2008, 12:33 PM
  7. Use array to do advanced filter?
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2005, 11:06 AM

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