+ Reply to Thread
Results 1 to 4 of 4

Extract numbers from text string

Hybrid View

cmb80 Extract numbers from text... 05-21-2017, 04:24 PM
mehmetcik Re: Extract numbers from text... 05-21-2017, 06:15 PM
AlKey Re: Extract numbers from text... 05-21-2017, 06:18 PM
cmb80 Re: Extract numbers from text... 05-22-2017, 05:17 AM
  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Extract numbers from text string

    Hi all I have many text strings that contain a series of numbers all separated by a space.

    These are in column A, in Column B I would like to know how many numbers are in each string that are lower than 75


    So in the example below the return would be 2

    18 22 90

    Example below would be 4

    2 33 49 65

    Any help appreciated

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

    Re: Extract numbers from text string

    I suppose that you could use an array formula for that, but that is beyond me.

    I would have to use a user defined function.

    
    Function NumCount(A As String, B As Long)
    MyArray = Split(A, " ")
    For Count = 0 To UBound(MyArray) - 1
    If MyArray(Count) < B Then NumCount = NumCount + 1
    Next
    End Function
    Enter your string in A1 and this formula into B2

    Formula: copy to clipboard
    =NumCount(A1,75)
    Last edited by mehmetcik; 05-21-2017 at 06:22 PM.
    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.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract numbers from text string

    Here is an array formula that will do it
    Formula: copy to clipboard
    =COUNT(IF(IFERROR(--MID(SUBSTITUTE(A1," ",REPT(" ",99)),99*(COLUMN(A:Z)-1)+1,99),"")<75,--MID(SUBSTITUTE(A1," ",REPT(" ",99)),99*(COLUMN(A:Z)-1)+1,99)))

    **Must be entered with Ctrl+Shift+Enter key combination.

    v A B
    1 18 22 90 2
    2 2 33 49 65 4
    3 99 45 65 79 110 63 3
    4 1225 33 489 63 15 78 1300 33 8 11 3 7
    Last edited by AlKey; 05-21-2017 at 06:38 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Extract numbers from text string

    Great stuff thanks both.

    Mehmetcik there were some instances were this did not calculate correctly, so I have used AlKey's method which I was a bit wary of as Array formula's can be quite heavy on a large data set but it seems to work perfectly

+ 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] help with a formula to extract numbers from a text string
    By Wannabarn in forum Excel General
    Replies: 9
    Last Post: 02-08-2017, 12:12 AM
  2. Extract Several Numbers From Text String
    By mvl3589 in forum Excel General
    Replies: 5
    Last Post: 06-21-2016, 08:11 PM
  3. [SOLVED] Extract numbers from text string
    By reynoldslarry in forum Excel General
    Replies: 6
    Last Post: 10-25-2014, 03:22 PM
  4. [SOLVED] Extract numbers from a string of alphanumeric text
    By Joshdm0716 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-09-2014, 08:28 PM
  5. extract and sum numbers from a text string
    By Shazwb in forum Excel General
    Replies: 5
    Last Post: 08-28-2011, 09:24 PM
  6. Extract numbers from text string
    By mkvassh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2009, 08:53 AM
  7. EXTRACT NUMBERS FROM TEXT STRING
    By fiber_doc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2005, 02:45 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