+ Reply to Thread
Results 1 to 2 of 2

Extract data from Range which appear N times

  1. #1
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Extract data from Range which appear N times

    I have a Range B5:B100, values are General, text and/or numbers
    A1=1 to 95 ...because in B5:B100 can be max 95 values
    I want to know in C5:C100, values from B5:B100 which appear A1 times !

    For example, If A1=5, list all which appear 5 times...
    Last edited by AliGW; 01-17-2020 at 02:03 AM.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Extract data from Range which appear N times !

    Picky: B5:B100 spans 96 rows, not 95.

    C5: =IFERROR(INDEX(B5:B100,MATCH($A$1,COUNTIF(B5:B100,B5:B100),0)),"")
    C6: =IFERROR(INDEX(B$5:B$100,MATCH($A$1,INDEX(COUNTIF(B$5:B$100,B$5:B$100)*(COUNTIF(C$5:C5,B$5:B$100)=0),0),0)),"")

    Fill C6 down into C7:C100. This is rather inefficient, but OK for one-off tasks or for small data sets like this. For repeated use and/or much larger data sets, it's more efficient to use supporting cells, specifically,

    X5: 1
    X6: =X5+1

    Fill X6 down into X7:X100. Select Y5:Y101, type =FREQUENCY(INDEX(MATCH(B5:B100,B5:B100,0),0),X5:X100), hold down [Ctrl] and [Shift] keys and press [Enter]. That should enter this formula into Y5:Y101 as an array formula.

    Z5: =IF(Y5=$A$1,1)
    Z6: =IF(Y6=$A$1,MAX(Z$5:Z5)+1)

    Fill Z6 down into Z7:Z100.

    C5: =IF(ROWS(C$5:C5)<=COUNT(Z$5:Z$100),INDEX(B$5:B$100,INDEX(X$5:X$100,MATCH(ROWS(C$5:C5),Z$5:Z$100,0))),"")

    Fill C5 down into C6:C100.

+ 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. Formula to see if start and end times fits a range of times
    By YMUNSHI in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-26-2019, 06:44 PM
  2. [SOLVED] Extract data in range
    By sanjuss2 in forum Excel General
    Replies: 7
    Last Post: 05-01-2015, 05:11 AM
  3. Extract data between two Times of the day.
    By winxp5421 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-11-2014, 06:20 PM
  4. [SOLVED] calculate turn around times range of times for weekday and weekend
    By xrayexceller in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-28-2013, 02:22 PM
  5. Copy data from a certain range and past multiple times.
    By Butehawk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2010, 09:15 PM
  6. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM
  7. copy a row multiple times according to a range of data
    By stakar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2009, 10:25 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