+ Reply to Thread
Results 1 to 4 of 4

Convert text to number?

  1. #1
    Forum Contributor
    Join Date
    03-03-2007
    Posts
    101

    Convert text to number?

    Hello all,

    Is it possible to extract a number from a text string, then use that number in a computation? Then spit the result back out as a text string?

    Here's the scoop.

    Step 1: The user types a number into cell A1. Let's use 99 for this example.

    Step 2: Excel concatenates the word "Years" with the number 99, then displays "99 Years" in the selfsame cell A1. (This is probably a weird request, but I have my reasons)

    Step 3: In cell B1 is a formula that adds 1 to whatever number was typed into cell A1. In this example the result would be 100.

    Step 4: Then Excel displays "100 Years" inside cell B1.

    What would be the formula to make this happen? Any ideas? Thank a mill.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Hi, Sean.

    Select cell A1, then go to Format > Cells. In the number tab, select Custom, then in the Custom box type in:

    0" Years"

    Now any number typed into A1 will be X Years.

    In cell B1, just use:

    =A1 + 1

    B1 may also need to have the custom format applied as stated above.

    HTH

    Jason

  3. #3
    Forum Contributor
    Join Date
    03-03-2007
    Posts
    101
    Wow that was simple. Thanks a bunch.

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    No problem.

+ 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