+ Reply to Thread
Results 1 to 8 of 8

Advanced searching problem (names)

  1. #1
    Registered User
    Join Date
    03-17-2015
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    3

    Advanced searching problem (names)

    Hi!

    I have a large database in excel that among other things contain a lot of names (both fornames, additional names, surnames, nick names and patronymics). I want to see how many people have a certain name, for example i want to know how many have the name Per, but not Casper or Persson. To make things more complicated there are multiple names in each cell.

    Is it possible to make a search like this?

    /Karl-Oskar

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Advanced searching problem (names)

    Use wildcards, like "?" or "*" and "space" in your search criteria, and some other things: char(32) or (char(160). I don't have your data so it's only assumption.

    i.e. "space"Per"space"

    regards
    sandy

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Advanced searching problem (names)

    Karl, welcome to the forum

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-17-2015
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    3

    Re: Advanced searching problem (names)

    Thank you for your help! I´ve tried to use space, but the problem is that the names can be both in the beginning, in the middle or at the end. I´ve attached just the names (they are coming from a database with genealogical research, and are names of people living in the 18-19th century. I´m trying to get good statistics about the different names and how often they are used.

    Thanks again for your help!

    /Karl-Oskar
    Attached Files Attached Files

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Advanced searching problem (names)

    1. in B2 =CLEAN(TRIM(A2)) and copy down
    2. in C2 = IF($C$1=0,0, (LEN(B2)-LEN(SUBSTITUTE(B2,$C$1,"")))/LEN($C$1)) with Ctrl+Shift+Enter and copy down (or double click on right down corner of selected cell C2)
    where C1 is yours criteria field, i.e.: spacePERspace (this formula is case sensitive)
    3. in D1 =COUNTIF(C2:C100138,"1") range can be different

    you can use filter also

    hope it will help

    btw, you should reorganize your data by removing non-data rows, formats, etc...

    here is a link to file not from forum because it is too big
    Namn2

    regards
    sandy
    Last edited by sandy666; 03-18-2015 at 07:03 PM.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Advanced searching problem (names)

    Can you show some samples of your expected outcome?

  7. #7
    Registered User
    Join Date
    03-17-2015
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    3

    Re: Advanced searching problem (names)

    Thanks a lot for your help! I will test your formula now in the weekend Sandy and see if I can get the hang of it. The full database contains more fields as cause of death, age, occupation and a lot more. In the long term I am going to make statistics with all this data!

    /Karl-Oskar

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Advanced searching problem (names)

    I used B2 cell but you can change it to what you want (i.e. with Data Validation support). But like I said before you need to "clean" your database from formats, non-printable characters, empty rows, etc.... Will be faster and easier

    regards
    sandy

+ 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. Searching for names in list.
    By madhatterz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-10-2013, 10:25 AM
  2. Advanced filtering, searching for a unique word
    By Yoruichi in forum Excel General
    Replies: 11
    Last Post: 04-29-2010, 07:21 PM
  3. searching names for '*', replacing it with first name
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2006, 01:35 PM
  4. Advanced Searching
    By Josh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2006, 04:10 PM
  5. Searching Names
    By exsam21 in forum Excel General
    Replies: 5
    Last Post: 01-17-2006, 05:40 PM

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