+ Reply to Thread
Results 1 to 21 of 21

Search Function for Department Directory

  1. #1
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Search Function for Department Directory

    Hello, I am looking for some help around my Company Directory.

    I want to be able to have a user friendly search function, which searches my second worksheet to pull up staff info. I've been googling all afternoon, and made a million formula changes, and cant get it to work.

    here is my sheet 1
    first.JPG

    my sheet 2 is where I keep all the raw data
    second.JPG

    How can I get this to work? I know its possible! I haven't worked with these types of formulas in YEARS, and feel like ive forgotten everything. HELP

    Is it evev possible to email the document to a professional and have them code it? at my wits end!

    Becca

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Search Function for Department Directory

    .
    Here is a similar project :

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

  3. #3
    Registered User
    Join Date
    09-17-2012
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Search Function for Department Directory

    Hello Becca,

    Are you only going to be searching based on the first name or can a user input any of the information (name, title, location, etc) and expect the results?

  4. #4
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    People here search first names mostly, id say 90% of the time.

  5. #5
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Logit: I'm going to play with what you've sent me this morning!!! I'll let you know how I made out! thank you!!!!!

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    Quote Originally Posted by Becca83 View Post
    People here search first names mostly, id say 90% of the time.
    What should happen if someone searches a first name where there are multiple matches?

    If you want a formulaic approach, please attach a small representative sample of your data along with the desired results (manually entered) of the formula/s.

    Also, a solution has to work 100% of the time so you need to decide if it should only work for first names or not.

  7. #7
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Quote Originally Posted by 63falcondude View Post
    What should happen if someone searches a first name where there are multiple matches?

    If you want a formulaic approach, please attach a small representative sample of your data along with the desired results (manually entered) of the formula/s.
    I see the issue, my search box ive built only shows one. What would be the most efficient way?

    I thought I was doing something easy, but I'm obviously in over my head

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  9. #9
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    This is what I started on and got lost on........I started with my gut, then made the mistake of using other forums that confused me.....and here I am
    Attached Files Attached Files

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    First off, you have trailing spaces in your data. For example, double click on Sheet2 A132. You will see that there is a trailing space at the end of Rebecca.

    While we can incorporate something in the formula to account for this, it is better to clean the data.
    I don't see any spaces in your column A data so a quick way to remove all spaces would be to select column A > Find & Select > Replace > Find what: type in a single space > Replace with: leave blank > Replace All

    I would recommend formatting your data in Sheet2 as a table in case you want to add more people to the data in the future (that way you can refer to the entire table column instead of a static range), but I will write the formulas for your data as is for now.

    Assuming that you want to return multiple matches, try these: (I un-merged the columns to account for multiple matches):

    C7 =IFERROR(INDEX(LastName,SMALL(IF(FirstName=$C2,ROW(FirstName)-(ROW($A2)-1)),COLUMNS($A1:A1))),"") Ctrl Shift Enter

    C8 =IFERROR(INDEX(Title,INDEX(MATCH($C6&C7,FirstName&LastName,0),0)),"")

    C9 =IFERROR(INDEX(Location,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    C10 =IFERROR(INDEX(Phone,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    C11 =IFERROR(INDEX(Ext,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    C12 =IFERROR(INDEX(Cell,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    Dragging the formulas through column F will allow for up to 4 matches (i.e. 4 people with the same first name). You can drag the formula over as far as you'd like.

    See attachment for clarification.
    Attached Files Attached Files

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Search Function for Department Directory

    .
    Please Login or Register  to view this content.
    This format allows you to search for anything: First name, Last name, Phone number, etc. etc. Everything is on one sheet though ...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Quote Originally Posted by 63falcondude View Post
    First off, you have trailing spaces in your data. For example, double click on Sheet2 A132. You will see that there is a trailing space at the end of Rebecca.

    While we can incorporate something in the formula to account for this, it is better to clean the data.
    I don't see any spaces in your column A data so a quick way to remove all spaces would be to select column A > Find & Select > Replace > Find what: type in a single space > Replace with: leave blank > Replace All

    I would recommend formatting your data in Sheet2 as a table in case you want to add more people to the data in the future (that way you can refer to the entire table column instead of a static range), but I will write the formulas for your data as is for now.

    Assuming that you want to return multiple matches, try these: (I un-merged the columns to account for multiple matches):

    C7 =IFERROR(INDEX(LastName,SMALL(IF(FirstName=$C2,ROW(FirstName)-(ROW($A2)-1)),COLUMNS($A1:A1))),"") Ctrl Shift Enter

    C8 =IFERROR(INDEX(Title,INDEX(MATCH($C6&C7,FirstName&LastName,0),0)),"")

    C9 =IFERROR(INDEX(Location,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    C10 =IFERROR(INDEX(Phone,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    C11 =IFERROR(INDEX(Ext,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    C12 =IFERROR(INDEX(Cell,INDEX(MATCH($C6&C7,FirstName&LastName,0),0))&"","")

    Dragging the formulas through column F will allow for up to 4 matches (i.e. 4 people with the same first name). You can drag the formula over as far as you'd like.

    See attachment for clarification.

    MAGIC!!!! Yes!!!! this looks great. and yes I will need the ability to add more and remove some as we grow

  13. #13
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Quote Originally Posted by Logit View Post
    .
    Please Login or Register  to view this content.
    This format allows you to search for anything: First name, Last name, Phone number, etc. etc. Everything is on one sheet though ...
    ANOTHER fantastic option. this is the best forum ever. I will play with these two and see which works best for my needs. you are fantastic!

  14. #14
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    Great, glad that we could help. Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    If you plan to add and remove people, select A1:G159 > Insert > Table > OK. You can then get rid of your named ranges and adjust the formulas to refer to the entire table columns instead of the named range.

  15. #15
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Quote Originally Posted by 63falcondude View Post
    Great, glad that we could help. Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    If you plan to add and remove people, select A1:G159 > Insert > Table > OK. You can then get rid of your named ranges and adjust the formulas to refer to the entire table columns instead of the named range.
    In my name manager?
    Capture.JPG

    so I sould change the G2-G159 to just, column G?

  16. #16
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    Those are the names that I am referring to.

    If the only thing that you use them for was for the formulas in Sheet1, you can delete them since they will no longer be needed.

    Then, after making the data into a table, change the formula from "Last Name" to "Table1[Last Name]", Cell to "Table1[Cell Number]", etc.

    Just keep in mind that copying the formulas across may change the column references since there isn't a way to make a table reference absolute.

    See attachment.
    Attached Files Attached Files
    Last edited by 63falcondude; 10-30-2017 at 01:59 PM. Reason: Added attachment

  17. #17
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Made it into a table, cant figure out renaming formula. I tried and it was inputting names?
    Attached Files Attached Files

  18. #18
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    I edited post #16 with an attachment of how the formulas should look after changing your data from a range to a table.

    Looking at your workbook from post #17, you didn't delete the named ranges.

  19. #19
    Registered User
    Join Date
    10-27-2017
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Search Function for Department Directory

    Oh, sorry, yes I knew you meant the name manager, where I had defined all the names. THANK YOU.

    I'll show this to IT, who is against Forums, and show them the capability of cooperatives ! WHOOHOOOOOOOOOOOOOOOOOO

  20. #20
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Search Function for Department Directory

    Great, happy to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  21. #21
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Search Function for Department Directory

    .
    You are welcome.

    I can't comment on IT depts. My experience has been very negative. Apologies to forum members who work in IT.

+ 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. Search directory - VLOOKUP
    By KevinRamsay in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-12-2013, 03:41 PM
  2. [SOLVED] Trying to skip a directory in search
    By Turtleman10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2013, 08:26 AM
  3. Need VBA code to search file in directory and sub-directory and show result
    By johnchencanada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2012, 11:13 PM
  4. macro to search in parent directory
    By jaango123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2011, 02:00 AM
  5. Search directory
    By beetlejuice1976 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2008, 09:26 AM
  6. Search for file in directory
    By ryanlcs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2008, 07:49 PM
  7. Search a directory for a file
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2006, 11:52 AM
  8. Directory Search
    By Stuie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2006, 06:43 PM

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