+ Reply to Thread
Results 1 to 11 of 11

Advanced Filter Problem with results using numbers formatted as text

  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 Filter Problem with results using numbers formatted as text

    I have posted similar to this perhaps a year or two ago, yet it goes unsolved. I hope with the attachment i can get to the bottom of what i am missing!

    Attached is (should be) a file named "FilterExample.xlsm". It is an extract from a NAICS database, that is an internationally recognized correlation of numeric codes to types of businesses.

    In using an Advanced Filter (Copy to location), the List Range is found in columns A & B. The Criteria Range is D1-E2, and the Copy To or Output range would be columns F & G.

    I want to use Advanced Filter in two ways:
    1. To enter a partial description in cell E2 and see all of the results over in F & G, and
    2. To enter part of the number in cell D2 and again see all results over in F & G

    If we type "Oil" (without quotation marks) in E2 and run the filter in COPY TO mode, we get every entry from columns A & B over in the output area that start with the word "Oil". I am happy.
    If we type "111" (without quotation marks) in E2 and run the filter in COPY TO mode, we get only the one entry that has 111 specifically -111 Crop Production - in the output area. I am not happy. I want every darned entry that starts with 111.

    I have tried formatting that first column as text (which, i believe, the example is), making sure that E2 is formatted as text also.

    I further find that if i enter "111*" (note the wildcard * at the end) in E2 i get NO results, same if i try "*111*" though if i use a wildcard at the beginning or end of the word "Oil" in the first example, it runs fine.
    The same occurs if i precede the 111 with the text tickmark '

    I must note now that in writing this i went to the length of putting one of those "tickmarks" in front of every item in column A and if i use '111* it runs right, but not if i just use '111 or 111*

    Should a cell formatted as text not be read the same as a cell's contents that has read-as-text tickmark as the first character?

    I want to believe that there must be a better way!

    What am i missing?

    Edit: Even if this is the only way, is there an easier way than to go to each entry and insert a ' myself? There are almost 3,000 of these and i find that creating another column with
    = "'" & A2
    and so on in it does not do the same as a direct entry of the tickmark at the start of the cell...
    2nd edit: So it was easy to add in the tick marks with code, but i still think something is wrong here - should be able to handle in a much simpler way-

    Thank-You Very Much!!!
    Attached Files Attached Files
    Last edited by brucemc777; 01-24-2019 at 06:59 PM. Reason: as noted

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Advanced Filter Problem with results using numbers formatted as text

    Try this:
    F1 must be blank
    F2: =LEFT(A2,3)="111"
    Criteria range F1:F2

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

    Re: Advanced Filter Problem with results using numbers formatted as text

    Select Column A, go to [TextToColumns] - [Next] - [Next] then choose "Text" and click [Finish].

    Change criteria in D2 to
    111*

  4. #4
    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 Filter Problem with results using numbers formatted as text

    Interesting, and Thank-you!

    @Akuini - i will experiment!

    @jindon - i hate to show off my ignorance, but may i ask where i would find [TextToColumns] ?

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

    Re: Advanced Filter Problem with results using numbers formatted as text

    It's in Data tab.

    What you need is to convert numbers in Col.A to text, so that you can use wild card.

  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 Filter Problem with results using numbers formatted as text

    Thank-you!

    I have never used this capability. I will have to learn more about it!

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

    Re: Advanced Filter Problem with results using numbers formatted as text

    You are welcome and thanks for the rep.

    Text to columns functionality is very useful when you need to convert data types.

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

  8. #8
    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 Filter Problem with results using numbers formatted as text

    I was considering hitting the "Solved" yesterday, the only thing that held me back is that the actual question was if there was some way to make the Advanced Filter work as i wanted to on the data without the conversion. Even when i formatted the column as "Text" by using the selected range, Format|Text it would not work, i had to do that which you suggested to make it work; i don't understand why they didn't achieve the same ends. Perhaps you can educate me?

    On the other hand, i suspect this was the only way to make this work, so i will "SOLVED" this now-

    Again, many thanks-
    -Bruce

  9. #9
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Advanced Filter Problem with results using numbers formatted as text

    Quote Originally Posted by brucemc777 View Post
    I was considering hitting the "Solved" yesterday, the only thing that held me back is that the actual question was if there was some way to make the Advanced Filter work as i wanted to on the data without the conversion.
    -Bruce
    Did you try my method (post #2)?
    By using advance filter with that method, you didn't need to convert the number to text.

  10. #10
    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 Filter Problem with results using numbers formatted as text

    Thank-you Akuini! I'm afraid i opted for the quick fix; i am looking forward to understanding and working your construct over the next few days. Just too much family stuff coming in on me right now to be able to do all i want!!!

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

    Re: Advanced Filter Problem with results using numbers formatted as text

    Don't know why, but >=111 in D2 is working with your workbook.

+ 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. Replies: 6
    Last Post: 05-17-2018, 10:20 AM
  2. [SOLVED] Limit Advanced Filter results
    By no_Fate in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-06-2016, 03:57 AM
  3. Different results for Auto Filter and Advanced Filter
    By me20161130 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2016, 09:02 AM
  4. Advanced Filter between two formatted Dates
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-29-2016, 06:24 PM
  5. 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
  6. [SOLVED] Advanced Filter results don't match auto filter
    By WaterWings in forum Excel General
    Replies: 1
    Last Post: 09-13-2012, 05:37 PM
  7. Lookup Problem with numbers formatted as text
    By jacob@thepenpoint in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2010, 01:05 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