Ask Your Question
1

How can I combine strings in Excel that have a common prefix?

asked 2023-07-15 19:51:43 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-07-15 19:52:01 +0000

devzero gravatar image

You can combine strings in Excel that have a common prefix by using the CONCATENATE function along with the LEFT and RIGHT functions. Follow these steps:

  1. Enter the prefix in a separate cell for reference.
  2. Use the LEFT function to extract the part of the string after the prefix.
  3. Use the RIGHT function to extract the part of the string before the prefix.
  4. Use the CONCATENATE function to combine the two extracted strings with the prefix.

For example, let's say you have a list of products with the prefix "Product-" and you want to combine them into one string:

  1. Enter "Product-" in a separate cell for reference (let's say cell A1).
  2. In another cell, use the LEFT function to extract the part of the string after the prefix. For example, if the first product is "Product-1", use the formula: =LEFT(B1,LEN(B1)-LEN(A1))
  3. In another cell, use the RIGHT function to extract the part of the string before the prefix. For example, if the first product is "Product-1", use the formula: =RIGHT(B1,LEN(B1)-LEN(A1))
  4. Finally, use the CONCATENATE function to combine the two extracted strings with the prefix. For example, if the first product is "Product-1", use the formula: =CONCATENATE(A1,C1,D1) (where C1 and D1 are the cells where the extracted strings are).

Repeat the above steps for all the products in your list, and you will have a new column with the combined strings.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-15 19:51:43 +0000

Seen: 10 times

Last updated: Jul 15 '23