Search code examples
concatenationgoogle-sheets-formula

Google Sheets - How to concatenate cells that meet a condition


enter image description here

I need to concatenate data from multiple rows/columns but skip columns where the value for the column is "None". I appreciate the help!


Solution

  • =TEXTJOIN(", ", TRUE, ARRAYFORMULA(IF(B5:F5<>"None",B4:F4&" - "&B5:F5, "")))

    Explanation:

    Use TEXTJOIN to join all the "A - 4 to 3" together with commas while skipping empty strings.

    Use ARRAYFORMULA and IF so that you concat row4 with row5 if value in row5 is not equal to "None", otherwise return empty string.