+ Reply to Thread
Results 1 to 6 of 6

Extract first 10 digit if preceding semicolon is >10 digit

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    Asia
    MS-Off Ver
    Office 2016
    Posts
    12

    Extract first 10 digit if preceding semicolon is >10 digit

    From sample data i trying to extract first 10 digit before semicolon having more than 10 digits.

    the length of the string can be quite long,
    does not follow same length or order, can have more than 50 strings of numbers (instead of 6 sets here) separated by semicolon:
    e.g.
    3214124141;141245141;6;12341;5674548;1217369889
    Output will be 1232141241 & 121736988

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Extract first 10 digit if preceding semicolon is >10 digit

    I'm a bit confused... your Output isn't consistent with your sample.

    Let me see if I understand this...

    First you extract out list of numbers separated by semicolon, which has more than 10 digits.
    From that result, you want first 10 digit before semicolon... meaning 10 digits preceding semicolon.

    Non of your example match first condition of Len(value) > 10. Longest digit only has 10 digit.
    Did you mean 10 or more digits?

    Also, should the result include last value after semicolon if it meets condition (i.e. value preceding line termination)?

    As well, how should the result be returned? As array? String?

    I'd recommend uploading sample workbook with few samples and manually created expected output.

    To upload file, use "Go Advanced" button, and find and click "Manage Attachments" hyperlink. This will launch new tab/window for managing uploads.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,023

    Re: Extract first 10 digit if preceding semicolon is >10 digit

    Cross-posted here: https://www.ozgrid.com/forum/forum/h...limit-by-comma

    Please be aware that our forum rules require you to tell us where else you have asked the same question. I have done this for you this time - if you cross-post again, you MUST do it for yourself. 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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Extract first 10 digit if preceding semicolon is >10 digit

    I would use a user defined function for that.

    However you example does not make sense.



    Place this code in to a Macro Module.

    Please Login or Register  to view this content.
    Then this formula in any cell will extract your data from cell A1

    =MyExtract(A1) will return 3214124141, 1217369889 this is not 1232141241 & 121736988 as you requested.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  5. #5
    Registered User
    Join Date
    02-11-2015
    Location
    Asia
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: Extract first 10 digit if preceding semicolon is >10 digit

    Hi the value got was 0 as the cell is filled with text and number. But thank u for proposing some solution i can consider working on.

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

    Re: Extract first 10 digit if preceding semicolon is >10 digit

    Adjust for your need.
    Please Login or Register  to view this content.

+ 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. Bank Recon - How to convert 8 digit formatted check numbers to 6 digit
    By Quisp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2017, 09:55 PM
  2. [SOLVED] Extract each digit from 3 Digit Numbers and put in other cells?
    By Brian.Aerojet in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 05-21-2017, 08:20 PM
  3. Replies: 10
    Last Post: 09-26-2015, 04:19 PM
  4. [SOLVED] LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 12:57 AM
  5. Extract 4 digit common numbers from 5 digit numbers
    By ameque in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2013, 01:09 AM
  6. [SOLVED] macro to extract 9 digit numbers as well as alpha numberic 9 digit numbers from txt file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2012, 10:15 AM
  7. Replies: 2
    Last Post: 06-17-2010, 08:36 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