You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

concatenate text to range of text cells in another column

I have a column of text in my rows of part number and part descriptions. I want to append to every text cell a string of text. How can I do that without having to visit each cell manually?

MacBook Pro 14″, macOS 14.6

Posted on Sep 25, 2024 7:35 AM

Reply
3 replies

Sep 27, 2024 8:44 AM in response to innersurf17

Since you're creating a new column of text, my earlier example should suffice, no?


It's just a matter of concatenating (using '&') the preamble of the URL, the contents of the product ID cell, and the rel/target parameters.


The only gotcha is that you're looking for quotes inside the result - to do that you need to double-quote so that Numbers knows to substitute a literal quote character.


Here's an example:


Column A has a series of product SKUs

Set the formula in cell B2 to:


="<br><A HREF=""https://site.dom/product/"&A2&""" rel=""noopener"" target=""_blank"">"


then fill down column B to fill out the table:



Sep 25, 2024 10:14 AM in response to innersurf17

Append the text in-place?


There's no way to automatically append a text value to a range of cells.


I can only think of two paths forward:


Use scripting (e.g. a script that calculates the amended text and updates the cell values).


Create a new temporary column that concatenates the existing column with the required text, then copy that column's values back to the source.

By this, assuming your current data is in column B, set the formula in C2 to:


=B2&"text to append"


you can then fill this formula down the column to calculate the range of values.

Then select the cells in Column C, copy them, then select Column B and select Edit -> Paste Formula Results

This will copy the value (not the formula) from column C into column B, which should do what you need.

Sep 27, 2024 5:13 AM in response to Camelot

Thx for that answer - now I guess I should have mentioned that I am creating a new column of text and some HTML like <br> <a href="rel="noopener" target="_blank"> - this is to be imported into a program that will format this description with text and html - is that possible? Do you have another suggestion? - it is only 2 columns, code and this description with html - thx for any help. btw - I have 120 rows to do :)


[Edited by Moderator]

concatenate text to range of text cells in another column

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.