Append & prepend string to existing rows

28,368

Solution 1

Assuming this is a one time thing...

  1. Insert a column next to the one you want to change
  2. write the formula as ="*"&B1&"*" where b1 is the 1st cell containing the number to add * to.
  3. go to the end of the column with the numbers, arrow over to the next cell (empty column with the formula.)
  4. press ctrl shift up arrow highlighting all the cells in that column from the last number to top.
  5. press ctrl d to fill down
  6. now highlight the column with the correct values (#) and select copy.
  7. right click on the original column letter.
  8. select paste special
  9. select values click ok
  10. delete the column you originally added.

Solution 2

You can do this with a basic auto-filled function. Are you familiar with auto-fill in excel?

Here is an example:

=IF(A2<>".","*"&A2&"*",A2)

1

Share:
28,368
Biker John
Author by

Biker John

:)

Updated on April 25, 2020

Comments

  • Biker John
    Biker John about 4 years

    I have a table of numbers:

    1
    2
    3
    4
    5
    6
    7
    .
    .
    .
    

    What i would like to get:

    *1*
    *2*
    *3*
    *4*
    *5*
    *6*
    *7*
    .
    .
    .
    

    I have written a formula, but i dont know how to apply this function to the existing table. I keep getting some kind of reference error. (REF!)

    My formula:

    = "*" & A2:A(whatever number is last) & "*"