ditto
ditto

Reputation: 6327

Google Spreadsheet Conditionally Join

I have spreadsheet with two columns.

|---|---------|
| 1 | 2382207 |
| 1 | 2382177 |
| 2 | 2382195 |
| 2 | 2382174 |
| 2 | 2382175 |
| 2 | 2382193 |

I want to join the contents of the second column together, with a | as the separator. I do with using =JOIN("|",B1:B6)

But now what I want is to only include those where the first column = 1. How could I do this conditionally join?

So the outcome that I want is 2382207|2382177

Upvotes: 1

Views: 105

Answers (2)

player0
player0

Reputation: 1

alternative:

=INDEX(TEXTJOIN("|"; 1; IF(A:A=1; B:B; )))

Upvotes: 0

BHAWANI SINGH
BHAWANI SINGH

Reputation: 729

you may use FILTER, =JOIN("|",FILTER(B1:B6;A1:A6=1))

Upvotes: 2

Related Questions