+ Reply to Thread
Results 1 to 4 of 4

Find position of last number in string

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Find position of last number in string

    Hi,

    I would like a macro to find the postition of the last number in a string. E.g. for "hello2021today" it should give 9.
    Any ideas?

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

    Re: Find position of last number in string

    Simple UDF.
    Use in cell like
    =FindLastDigit(A1)
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,420

    Re: Find position of last number in string

    You say you want a macro, but it sounds more like you would want a UDF (user defined function), so that is what I am giving you (you can convert this easily enough into a macro if that is really what you want)...
    Please Login or Register  to view this content.

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

    Re: Find position of last number in string

    Quote Originally Posted by MaartenRo View Post
    E.g. for "hello2021today" it should give 9.
    Post #2 or
    =MAX(IF(ISNUMBER(MID(A1,ROW(1:500),1)+0),ROW(1:500)))
    Confirm with Ctrl + Shift + Enter (array formula entry)

+ 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. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2005, 12:05 AM
  2. find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 11:05 PM
  3. [SOLVED] find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 10:05 PM
  4. [SOLVED] find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 PM
  5. [SOLVED] find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 PM
  6. [SOLVED] find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  7. [SOLVED] find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  8. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 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