+ Reply to Thread
Results 1 to 5 of 5

Find first numeric value in a string

  1. #1
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    91

    Find first numeric value in a string

    Hello.

    I'm not sure if this was asked before, I tried to search but couldn't find a thread. Apologies if it's asked before:

    So I have a range of "complicated" data, in which I'm trying to find the 1st numeric value. For this I'm currently using a nested SUBSTITUTE to convert all numbers to 0, then a FIND to find the 1st zero, then a LEFT to get the number based on the FIND result. This does the job but it feels too convoluted, and looks kind of ugly. Is there a simpler way to accomplish this?

    Either the first number or it's position. Both works for me.

  2. #2
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Find first numeric value in a string

    Hi Mgc26133

    Guessing a little, if you have the text in H9, try:
    PHP Code: 
    =MID(H9,MIN(FIND({0;1;2;3;4;5;6;7;8;9},H9&1/17)),1
    If not, post an Excel file showing us what do you have and what do you want to get. Blessings!

  3. #3
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    91

    Re: Find first numeric value in a string

    No need, this is exactly what I want!

    Many thanks !!

    Quick question though.. What does "&1/17" do there?

  4. #4
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Find first numeric value in a string

    Hi again!
    1/17 is a pandigital number (the result contains all the digits (0 to 9)). This concatenation to original number avoid errors to the FIND part. Blessings!

  5. #5
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    91

    Re: Find first numeric value in a string

    Brilliant!

+ 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] Find the last numeric position in a text string
    By Raymond18 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 01-15-2022, 05:57 AM
  2. [SOLVED] Break String and find numeric value
    By majidsiddique in forum Excel General
    Replies: 5
    Last Post: 09-19-2019, 01:10 AM
  3. [SOLVED] Formulas to find the first and last numeric value and text string in a column
    By Rambo4711 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-12-2013, 05:20 AM
  4. [SOLVED] If Statement not finding Numeric Values but will find a string
    By mattyh555 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-27-2012, 03:05 PM
  5. Extracting Numeric Values from an Alpha/Numeric String
    By Delkath in forum Excel General
    Replies: 5
    Last Post: 10-27-2010, 02:36 PM
  6. Find numeric value at end of string
    By Barb Reinhardt in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-04-2006, 07:35 PM
  7. [SOLVED] Find first numeric value in text string
    By Rbp9ad in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-14-2005, 09: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