+ Reply to Thread
Results 1 to 7 of 7

Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results different

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results different

    Heck, I don't know how to phrase the issue in the Title line...

    I have two columns, the first has numbers, the second has characters, this is from a NAICS listing, excerpt as follows:

    Code Description
    11 Agriculture, Forestry, Fishing and Hunting
    111 Crop Production
    1111 Oilseed and Grain Farming
    11111 Soybean Farming
    111110 Soybean Farming
    11112 Oilseed (except Soybean) Farming
    111120 Oilseed (except Soybean) Farming
    11113 Dry Pea and Bean Farming
    111130 Dry Pea and Bean Farming
    11114 Wheat Farming
    111140 Wheat Farming
    11115 Corn Farming
    111150 Corn Farming
    11116 Rice Farming
    111160 Rice Farming
    11119 Other Grain Farming
    111191 Oilseed and Grain Combination Farming
    111199 All Other Grain Farming

    I have formatted both columns as text.

    I have further created my filter criteria as such:

    Code Description


    with both cells under each column title being formatted as text.

    Now, I want to filter on either column depending on user choice, and am able to do so, but I only get the desired result filtering on "Description" and not on "Code".

    When I filter on "Description" and put in a letter I get ALL results that start with that letter. For instance if I entered the letter "O" I would get the following with which to populate my listbox:
    1111 Oilseed and Grain Farming
    11112 Oilseed (except Soybean) Farming
    111120 Oilseed (except Soybean) Farming
    11119 Other Grain Farming
    111191 Oilseed and Grain Combination Farming

    However...

    When I put in the first digit in "Code" (Please note, the first digit in the entire first column goes on to include 1-9), I only get an entry that corresponds to that specific entry, even if I append * to it. For better example, if I enter 11119, instead of getting:

    11119 Other Grain Farming
    111191 Oilseed and Grain Combination Farming
    111199 All Other Grain Farming

    I only get:
    11119 Other Grain Farming

    Is there a way to get what I want?

    Thank-you all!!!
    Last edited by brucemc777; 05-11-2018 at 05:47 PM. Reason: Attempting to clarify

  2. #2
    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,939

    Re: Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results differ

    Have you considered just using regular filters?
    Home tab/Editing/Filter and Sort/Filter
    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

  3. #3
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results differ

    In that you are an Admin, I guess the first part of my answer is "Nope, you can't do that with an advanced filter, even if you formatted your numbers as text!"...

    Using a regular filter still runs into a similar problem as though the "Code" column is formatted as text, the regular filter only provides "Number Filters" and not "Text Filters". With this there is no way I see to extract all named range rows that the Code column begins with "111" for instance.

    Though I suppose I could accomplish this with a loop using FindNext, I suspect this would result in longer delays between keystrokes. In this implementation it is reasonable to presume the user might know the first one, two, three or more digits in the sequence and simply be looking to narrow down to the end result, so reiterative searches displaying the results is needed. I use the output of the advanced find to populate a listbox. An entry in the listbox can be selected for the desired result of these procedures. The available field to select from can be relatively large and the desired result might not be narrowed down to enough to make a choice until five digits have been entered (the listing I am working with has a max of 6 digits for the "Code" column.

  4. #4
    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,939

    Re: Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results differ

    upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

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

    Re: Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results differ

    1) Select "Code" column
    2) [Data] - [Text to column] - [Next] - [Next] - Choose "Text" - [Finish]

    Then you should be able to select Text Filter.

  6. #6
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results differ

    @FDibbins: I will try to create an extract from the main workbook that will function independently and upload, Thank-you!
    @jindon: You have helped me before and I am grateful. I'm afraid it didn't work and very likely because of unclarity in my explanation, but when I am able to get the sample uploaded I thing it will clarify things!

  7. #7
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: Advanced Data FIlter: Two columns: Numbers as text, Characters as text: Results differ

    OK! Sorry it took me so long!

    I believe the attached file will demonstrate the problem I described above.

    The worksheet has a button to open the selection form. Once the selection form is open you can choose to enter by "direct entry" which is typing in the numbers, or by description.

    If "Description" is selected then along the lines of the description of the problem if one enters "oil" (without quotation marks), a list of anything with "oil" will appear in the expanded box. If one selects "Direct Entry" and enters "11", only the item that is "11" appears, not "111" nor "1111", nor...

    The reason for wanting everything that starts with a given numerical sequence is that these categories start with a broad base of a field and gradually narrow it down to a specific, so I might know that "11" is "Agriculture, Forestry, Fishing and Hunting" and know that the industry that I want is somewhere within that major classification, but wish to see all the items that start with "11" to narrow down the search or select the specific item, perhaps looking for "112112" which would be "Cattle Feed Lots". This also applies to if I knew the industry that I was searching for was within "112" or within "1121" or even "11211".

    You can disregard columns A-F - that was part of a "work in progress"

    Thank-you for taking the time to review!
    Attached Files Attached Files
    Last edited by brucemc777; 05-17-2018 at 10:59 AM. Reason: Clarification (I hope)

+ 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] Advanced Filter on Partial Text
    By endly in forum Excel General
    Replies: 2
    Last Post: 09-19-2015, 04:41 PM
  2. Advanced Filter to show desired text or numbers typed in a search box
    By GabrielAlin in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-24-2015, 01:04 AM
  3. Advanced Filter and data inside a text field
    By showgie in forum Excel General
    Replies: 2
    Last Post: 07-07-2010, 04:50 PM
  4. Advanced filter for <> several text strings
    By ilscfn in forum Excel General
    Replies: 11
    Last Post: 01-09-2010, 06:06 AM
  5. Advanced Text Filter
    By McElduff in forum Excel General
    Replies: 3
    Last Post: 04-11-2009, 07:12 AM
  6. Results of List of Data with Advanced Filter
    By vtphilk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2008, 06:21 PM
  7. Replies: 3
    Last Post: 12-20-2007, 03:50 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