+ Reply to Thread
Results 1 to 4 of 4

Equation based on one cell with word & number

  1. #1
    Forum Contributor dagindi's Avatar
    Join Date
    06-02-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    295

    Equation based on one cell with word & number

    Is it possible for Excel to run an equation based on a cell that contains a word and a number. For example:
    A1 = $100,000
    A2 = Bob 15
    A3 = James 8
    A4 = Michelle 18

    Can excel identify the number and multiply by $100,000??
    Last edited by NBVC; 02-10-2011 at 08:51 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Equation based on one cell with word & number

    If separated with space as shown, and consistently that way, then

    =MID(A2,FIND(" ",A2)+1,100)*A$1

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor dagindi's Avatar
    Join Date
    06-02-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    295

    Re: Equation based on one cell with word & number

    After I posted and looked at what I wrote the concept came to me but not the solution.

    Can you explain the "+1,100)" part of the equation?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Equation based on one cell with word & number

    In this formula: =MID(A2,FIND(" ",A2)+1,100)*A$1

    First we look for the space in celll A2, by using FIND(" ",A2)... I add 1 to move to first digit (although not really needed in the end, because the space would be "canceled out" in the multiplication with A$1. The result is the position number within A2 where the first digit occurs.

    Then the MID() function looks along string A2, starting at the position found by the FIND()+1 function.. and extract upto 100 characters from there... if the number of characters is less than 100 it just grabs all (100 is a safety number really)...

    The result is multiplied by A1.

+ 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