+ Reply to Thread
Results 1 to 8 of 8

Formula to produce list of data based on criteria

  1. #1
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Formula to produce list of data based on criteria

    I have a list of 20 job titles in column A and a list of data in the next column (B). I want to generate a list of job titles based on the data in B.

    So if there is an X in column B the job title appears in a list.

    Eg

    Job 1 X
    Job 2 X
    Job 3
    Job 4 X
    Job 5
    Job 6
    Job 7
    Job 8 X

    ..would return, in another column;

    Job 1
    Job 2
    Job 4
    Job 8

    Thanks in advance for any help.

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula to produce list of data based on criteria

    Hi,

    in C2

    Please Login or Register  to view this content.
    You have to finish the input of the formula with Ctrl+Shift+Enter rather than Enter.

    Array formulae are embraced by curlies to indicate that they are arrays o be confirmed with control+shift+enter

    Greetings
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Formula to produce list of data based on criteria

    Quote Originally Posted by CANAPONE View Post
    Hi,

    in C2..
    Thanks, but how will this return all results if it's only in one cell (C2)?

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula to produce list of data based on criteria

    Hi, once you have copied and confirmed the formula in C2 (in the example) you have to copy down the formula (in C3:C10 for istance).

    =if(iserror(index($A$2:$A$100,small(if($B$2:$B$100="X",row($A$1:$A$99)),row(A1)))),"",index($A$2:$A$100,small(if($B$2:$B$100="X",row($A$1:$A$99)),row(A1))))

    The segment row(a1) becomes row(a2) (i.e. 2 ), row(a3) (i.e. 3) ...and allows to extract from the list the other elements that match the criteria.

    Attached a small example.

    Hope it helps
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Formula to produce list of data based on criteria

    Quote Originally Posted by CANAPONE View Post
    Hi, once you...

    That's brilliant, thankyou.

  6. #6
    Registered User
    Join Date
    06-23-2012
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to produce list of data based on criteria

    Hey, I want to do a similar thing like this, but not with "X", instead I want to categorize my whole list of 2 columns into 3 separate lists, as per the 3 categories present in column 2. And the length of the list vary to any number. Could please help me putting out the same.

    Thanks in advance.

  7. #7
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Formula to produce list of data based on criteria

    Quote Originally Posted by dr.rohit View Post
    Hey, I want to do a similar thing like this, but not with "X", instead I want to categorize my whole list of 2 columns into 3 separate lists, as per the 3 categories present in column 2. And the length of the list vary to any number. Could please help me putting out the same.

    Thanks in advance.
    I think the above solution should work, but change the "X" in your first 'results' column to your first value, your second column to your second value and third column to third value, then drag it down as long as needed.

  8. #8
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula to produce list of data based on criteria

    Hi dr.rohit, hi samcdavies,

    as you are an Excel 2010 user, you could also substitute the scheme

    =if(iserror(formula),"", formula)

    into a much simple

    =iferror(formula,"")

    Example:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Again, they are array formulae to be confirmed with control+shift+enter.

    Cheers
    Last edited by canapone; 06-23-2012 at 10:27 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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