Select all cells data and add in a new cell with comma separated in excel

Created at 22-Feb-2023 , By samar

When working with large datasets in Excel, it can be useful to combine the data from multiple cells into a single cell. One way to do this is to use the TEXTJOIN formula, which allows you to concatenate text from a range of cells into a single string, separated by a specified delimiter (comma).

=TEXTJOIN(",",TRUE,A4:A8)


=TEXTJOIN(",",TRUE,A4:A8) is an Excel formula that combines text from a range of cells (in this case, A4 through A8) into a single string, separated by a delimiter (in this case, a comma). The resulting string is returned as the output of the formula.

Here's how the different arguments in the formula work:

",": This is the delimiter that will be used to separate the text from each cell. In this case, a comma is used, but you can use any other character or string as the delimiter.
TRUE: This argument tells Excel to ignore any empty cells in the range. If you set this argument to FALSE (or omit it altogether), empty cells will be included in the output string, separated by the delimiter.
A4:A8: This is the range of cells that will be concatenated into a single string. In this case, the range starts with cell A4 and ends with cell A8, so any text contained in those cells will be included in the output string.

So, for example, if cells A4 through A8 contain the following text:

A4: Java
A5: Python
A6: JavaScript
A7: Ruby
A8: Swift

The formula =TEXTJOIN(",",TRUE,A4:A8) would return the following string in a single cell:

Java, Python, Javascript, Ruby, Swift

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.