+ Reply to Thread
Results 1 to 13 of 13

custom search function that list all the result in one place

  1. #1
    Registered User
    Join Date
    08-25-2016
    Location
    kay ell
    MS-Off Ver
    2007
    Posts
    33

    custom search function that list all the result in one place

    hello all

    what i like to do is imitate the search function within excel but with slight enchancement

    this i what i would like to achieve:

    1. push a button in sheet DB , an input box will pop-up
    2. key-in the keywords in the input box , it can be
    words or numbers , just like the excel search functiion
    3. the result will be appeardd in the RESULT sheet
    4. below are few examples what i want to achieve:

    example 1 ..if i keyin the keyword NEW , the result that appear in the RESULT sheet will be :

    site id site name key details
    1234 new york keso , master key
    3765 new albany 8.1 , bm key

    example 2 ..if i keyin the keyword 4343 , the result that appear in the RESULT sheet will be :
    site id site name key details
    4343 seattle site key

    thanks in advance

    PS: please refer to attachment for further understanding , tq again
    Attached Files Attached Files
    Last edited by smatbis; 04-06-2018 at 10:13 AM. Reason: problem solved

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

    Re: custom search function that list all the result in one place

    You can do this with a couple of formulae. In the result sheet I've left a gap for you to enter your search criteria in row 2 (the yellow cells).

    I've used this formula in D2 of the DB sheet:

    =IF(AND(A2<>"",A2=RESULT!$A$2)+AND(RESULT!$B$2<>"",COUNTIF(B2,"*"&RESULT!$B$2&"*"))+AND(RESULT!$C$2<>"",COUNTIF(C2,"*"&RESULT!$C$2&"*")),MAX(D$1:D1)+1,"-")

    and this can be copied down as far as you need to - the hyphens indicate where the formula is active. This formula identifies the records which match the criteria and gives each a unique sequential number.

    I used this formula in A4 of the Result sheet:

    =IFERROR(INDEX(DB!A:A,MATCH(ROWS($1:1),DB!$D:$D,0)),"")

    which is then copied across into B4:C4 and then copied down as far as is required (I've copied to row 12). You can see the result with "new" in B2.

    Hope this helps.

    Pete
    Attached Files Attached Files

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: custom search function that list all the result in one place

    Here's another approach which uses a macro to filter the results

    Just enter the key word in F1 on the db sheet. There seems little point in having a button and pop up input box since that's just adding to the number of keystrokes needed.

    The Sheet Change macro is
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: custom search function that list all the result in one place

    Similar (to Richard Buttrey) but different
    - uses standard data filter
    Attached Files Attached Files
    Last edited by kev_; 04-04-2018 at 06:06 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Registered User
    Join Date
    08-25-2016
    Location
    kay ell
    MS-Off Ver
    2007
    Posts
    33

    Re: custom search function that list all the result in one place

    thanks to all posters for the great effort
    unfortunately it doesnt do what i intend to do

    my task is to create a search engine similar to "ms excel built in find and replace"

    the difference is ::
    i want to display a list of result based on my keyword in a different page , while if i use "find and replace" built in , i only can use it at the same sheet and it will scroll down or scroll up if the keyword make return

    the search depends on the keyword , partially or whole , just like when you use find and replace in ms excel

    so it will very helpful when user search in a larger list and want to display all the result , in a different sheet.

    hope someone can help me achieving this, thank you again

  6. #6
    Registered User
    Join Date
    08-25-2016
    Location
    kay ell
    MS-Off Ver
    2007
    Posts
    33

    Re: custom search function that list all the result in one place

    Quote Originally Posted by kev_ View Post
    Similar (to Richard Buttrey) but different
    - uses standard data filter

    hello sir

    at first i dont understand you work method

    but after look carefully your work flow...finally i understand it

    your method come very close to my requirement

    but one thing occured

    on the sample site id that i use in my ws example , it only contain number , which is 4 number

    in my real data , my format is numbers and an letters...i.e C1234C or VB6723Z

    the sample you give me works fine when my site id is in numbers

    but when my site id contain letters , such as 1234C or 6723ZX... it return nothing

    could you please help me again, thanks again


    PS: please refer to attachment , tq


    OTHER PROBLEM THAT I NOTICED...

    1. i cannot use the keyword for example 1234 because it will return nothing
    i want to be able just typing "123" and it will list all the 123 inside my Db , tq again
    Attached Files Attached Files
    Last edited by smatbis; 04-05-2018 at 04:37 AM.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: custom search function that list all the result in one place

    Amended as requested
    Attached Files Attached Files

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: custom search function that list all the result in one place

    Re the #3 solution.
    Change your column A Data to be text not numbers and then A3 on the Results sheet to be

    ="*"&DB!F1&"*"

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: custom search function that list all the result in one place

    Try
    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: custom search function that list all the result in one place

    You can change my first formula to this in D2 of the DB sheet:

    =IF(AND(A2<>"",COUNTIF(A2,"*"&RESULT!$A$2&"*"))+AND(RESULT!$B$2<>"",COUNTIF(B2,"*"&RESULT!$B$2&"*"))+AND(RESULT!$C$2<>"",COUNTIF(C2,"*"&RESULT!$C$2&"*")),MAX(D$1:D1)+1,"-")

    if your site ID values are text.

    Hope this helps.

    Pete

  11. #11
    Registered User
    Join Date
    08-25-2016
    Location
    kay ell
    MS-Off Ver
    2007
    Posts
    33

    Re: custom search function that list all the result in one place

    Quote Originally Posted by kev_ View Post
    Amended as requested
    fantastic sir...well appreciated and tq

  12. #12
    Registered User
    Join Date
    08-25-2016
    Location
    kay ell
    MS-Off Ver
    2007
    Posts
    33

    Re: custom search function that list all the result in one place

    Quote Originally Posted by jindon View Post
    Try
    Please Login or Register  to view this content.
    thanks sir

    another awesome approach, thanks...

  13. #13
    Registered User
    Join Date
    08-25-2016
    Location
    kay ell
    MS-Off Ver
    2007
    Posts
    33

    Re: custom search function that list all the result in one place

    Quote Originally Posted by Pete_UK View Post
    You can change my first formula to this in D2 of the DB sheet:

    =IF(AND(A2<>"",COUNTIF(A2,"*"&RESULT!$A$2&"*"))+AND(RESULT!$B$2<>"",COUNTIF(B2,"*"&RESULT!$B$2&"*"))+AND(RESULT!$C$2<>"",COUNTIF(C2,"*"&RESULT!$C$2&"*")),MAX(D$1:D1)+1,"-")

    if your site ID values are text.

    Hope this helps.

    Pete
    thanks sir for the effort

+ 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. [SOLVED] Trying to create a macro to place selected values from a file search into a list
    By Cbird in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2017, 11:35 PM
  2. [SOLVED] Function that will search partial text match and place a 1 in column
    By thebrin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2017, 01:38 AM
  3. Place result of random number generation in a list
    By gpmattes in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-15-2016, 07:11 AM
  4. [SOLVED] Using VBA to round a function and place result in cell
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2016, 11:22 AM
  5. Replies: 8
    Last Post: 07-12-2013, 09:06 AM
  6. How do I show a custom function text result instead of seeing 0
    By jeichenlaubjr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2010, 12:33 PM
  7. Custom Function from worksheet result
    By tJasC3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2008, 04:24 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