+ Reply to Thread
Results 1 to 4 of 4

Trying to find a formula to find a random $ amount in a text in a cell

Hybrid View

  1. #1
    Registered User
    Join Date
    01-28-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    2

    Trying to find a formula to find a random $ amount in a text in a cell

    I have a string of text and there is either one or two dollar amounts within the text. I'd like to be able to pull those dollar amounts into another cell. The location within the cell varies and the dollar amounts vary. Example:

    $125.95 a month, for a savings of $22.00 a month

    and/or

    Sales within a month is $130 a month for the month of January

    Is there something that could find $ and pull the amounts in the next one and/or two cells?

    Any help would be most appreciated. Thank you.
    Last edited by Miki1; 01-28-2013 at 10:17 PM. Reason: Solved

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,825

    Re: Trying to find a formula to find a random $ amount in a text in a cell

    Suppose you have those two phrases in A1 and A2. Then you can put this formula in B1 to get the first number:

    Formula: copy to clipboard
    =IF(ISNUMBER(FIND("$",A1)),--MID(SUBSTITUTE(A1," ",REPT(" ",10)),FIND("$",SUBSTITUTE(A1," ",REPT(" ",10)))+1,10),"")


    Copy it down column B for as many phrases that you have.

    Put this formula in C1 to get the second number (if it exists):

    Formula: copy to clipboard
    =IF(AND(ISNUMBER(FIND("$",A1)),LEN(A1)-LEN(SUBSTITUTE(A1,"$",""))>1),--MID(SUBSTITUTE(A1," ",REPT(" ",10)),FIND("$",SUBSTITUTE(A1," ",REPT(" ",10)),FIND("$",SUBSTITUTE(A1," ",REPT(" ",10)))+1)+1,10),"")


    and again, copy down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-28-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Trying to find a formula to find a random $ amount in a text in a cell

    Hi Pete,
    Thank you. AWESOME! It works perfect! You have saved me soooo much time. Thank you.

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Trying to find a formula to find a random $ amount in a text in a cell

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as "SOLVED".

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Note:
    You can also thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given.
    By doing so you can add to the reputation(s) of those who helped and shared their time in helping you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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