Home > Mobile >  concatenate with null and no condition
concatenate with null and no condition

Time:10-09

https://img.codepudding.com/202210/ae80d5e6586c402e80828db4e01851be.png

From the attached image in column DN, I am concatenating columns from DJ to DM. But if the cell contains null value or no it shouldnt print in the concatenation. can someone pls guide me in this by suggesting ideas how can i proceed further Thanks in advance

CodePudding user response:

If you have access to O365, and thus access to FILTER() and TEXJOIN(), then you can do this all in a fairly simple formula and not require VBA. You'll end up with

=TEXTJOIN(",",TRUE,FILTER(DJ5:DM5,DJ5:DM5<>"no",""))

in DN5 and copy it down. The FILTER takes care of the "no" values and the "true" in TEXTJOIN correctly ignores blank cells.

You can go further by using the BYROW or MAKEARRAY function to calculate the entire result in column DN all at once with a single formula in DN5.

  • Related