W
W
WebforSelf2021-10-05 15:48:34
excel
WebforSelf, 2021-10-05 15:48:34

How to remove extra commas?

There are multiple columns

1         2        3        4
знач    знач2         знач4


I use
=CONCATENATE(RC[1];",";RC[2];",";RC[3];",";RC[4])

As a result, since the third column does not have a value, it turns out like

this , val2,,val4

How to remove these extra commas? if any of the columns have no value.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
John Smith, 2021-10-05
@WebforSelf

If EXCEL is version 2019 or higher, you can use the new TEXTJOIN function.
It allows you to specify a separator, ignore empty cells, and the actual range of cells.
https://easy-excel.com/how-to-join-text-from-sever...
Significantly simplifies concatenation.
Those. it all boils down to the formula =TEXTJOIN(",";TRUE;%a_here_range_of_cells to merge%). TRUE in the second argument just sets the empty cells to be ignored.

A
Alexander, 2021-10-05
@ForestAndGarden

You can use the SUBSTITUTE function, or you can check for the presence of values ​​in the cells.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question