+ Reply to Thread
Results 1 to 4 of 4

Search function

  1. #1
    Registered User
    Join Date
    06-07-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Search function

    Hi

    I am trying to create a search function in excel. The data sheet has the company name in row 1 and the credit ratings in row 2. I want to see a list of all companies with a BBB rating. Please could someone help?

    E.g.

    Company 1 Company 2 Company 3 Company 4
    BBB A- BBB+ BBB

    I search for BBB and the names for Company 1 and Company 4 are returned. The data set has about 150 entries and will continue to grow and certain searches will return more than 10 entries.

    Thanks

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Search function

    Assuming your companies start in B1 and ratings in B2 and run horizontally...

    then in a new row, say, B3, enter =IF(B2=$X$2,COUNT($A3:A3)+1,"") and copy across.

    where $X$2 contains the search criteria.

    then in B4 = MAX(3:3)

    then to extract the data:

    =IF(Columns($A$1:A$1)>$B$4,"",INDEX($1:$1,Match(Columns($A$1:A$1),$2:$2,0))

    and copy across...

    or


    =IF(Rows($A$1:$A1)>$B$4,"",INDEX($1:$1,Match(Rows($A$1:$A1),$2:$2,0))

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-07-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Search function

    Thanks. I am struggling with the extraction of the data. As it does not seem to work. I have got the below. Sorry I maybe being slow:

    company 1 company 2 company 3 company 4
    bbb a- bbb+ bbb
    1 2
    2
    Formula?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Search function

    Sorry that last formula should be:

    =IF(COLUMNS($A$1:A$1)>$B$4,"",INDEX(1:1,MATCH(COLUMNS($A$1:A$1),3:3,0)))

    i referenced row 2 instead of row 3...

+ 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