+ Reply to Thread
Results 1 to 5 of 5

Looking for a way to filter this - see example

  1. #1
    Registered User
    Join Date
    06-02-2012
    Location
    North Carolina
    MS-Off Ver
    Microsoft 365 Excel 2019 build 14430.20298
    Posts
    11

    Looking for a way to filter this - see example

    Hi,

    I'm looking for a way to filter two eight digit serial numbers located in one Excel cell. (data was imported to excel from a database)

    So the cell could contain two 8 digit numbers, but sometimes will only contain one. I want to filter out any cell with number below a certain value say 25028500. The problem is the two numbers in a single cell. Not sure how to filter for this...

    For example:

    25028336 25032995 (first number is below 25028500, second is above)
    25014962 (below)
    25013562 25034339 (first is below, second above)
    25029962 25031032 (both above)
    25036921 (above)

    etc

    Thanks in advance!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Looking for a way to filter this - see example

    You could use LEFT and RIGHT to get the numbers and compare each to the number.

    For example, =LEFT(A1,8)+0 > 25028500, and, =RIGHT(A1,8)+0 > 25028500

    The only complication is if there's only one number. In that case, =IF(LEFT(A1,8)+0 = RIGHT(A1,8)+0, "", RIGHT(A1,8)+0 > 25028500)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-02-2012
    Location
    North Carolina
    MS-Off Ver
    Microsoft 365 Excel 2019 build 14430.20298
    Posts
    11

    Re: Looking for a way to filter this - see example

    Is there a way for the filter to keep the value of the number rather than a "True" or "False"?

    I'm almost there, I used LEFT and RIGHT to get the first and second number (8 digit value) in a new column (Serial 1 and Serial 2), however I have a repeat number if there is only 8 digit number one to begin with. Anyone know a good way to remove the entry in Serial 2 if it is equal to Serial 1? I could manually go back and delete the duplicates, but I'd rather have Excel do the work for me. I used conditional formatting to highlight value > 25028500.

    Here is an example of how it looks: Left column is how data is pulled from data base (one or both 8 digit numbers in one column) and the two columns on the right (Serial 1 and Serial 2 respectively) are where I used the LEFT and RIGHT to extract the first and second numbers from the original column.

    Attachment 752715
    Last edited by Buchu; 10-22-2021 at 09:38 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Looking for a way to filter this - see example

    Attach a workbook, not a picture of one.

    Administrative Note

    Members will tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    06-02-2012
    Location
    North Carolina
    MS-Off Ver
    Microsoft 365 Excel 2019 build 14430.20298
    Posts
    11

    Re: Looking for a way to filter this - see example

    Here is a workbook.

    Attachment 752728

+ 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. Inserting filter into pivot table via macro errors if filter doesn't exist.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2018, 10:24 AM
  2. VBA Advanced Filter - Two Filters Without Deleting Bottom Filter Data In Same Column Range
    By hysterical.useless in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2017, 02:54 PM
  3. Macro to filter a pivot whilst looping through filter criteria in a variable list.
    By Alistairm88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2015, 04:25 AM
  4. [SOLVED] Excel 2007-Adv Filter Copy and Loop with Nested Autofilter Using Values from Adv Filter
    By Southfish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2014, 02:07 AM
  5. Replies: 6
    Last Post: 10-16-2014, 08:42 AM
  6. Need to filter a report filter based on the previous filter
    By elliotencore in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-28-2014, 07:44 AM
  7. Filter several pivot tables by one programmed date range filter in Excel 2003
    By olewka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2011, 11:49 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