简体   繁体   中英

Google sheets return a string of concatenated values from a range based on value

I appreciate this question might be on the incorrect Stackexchange website but this is the one I frequent most often and wasn't sure of a more appropriate one - so feel free to move it mods if required.

Basically I have the following scenario:

问题

What I'm trying to do in Google sheets is write a formula which will return me a concatenated string of the name of players that need items, in the cell which corresponds with the boss. Eg B9 would read "Player 2, Player 4" C9 would read "Player 3, Player 4".

Unsure if this is even possible in Google Sheets; I'm sure it is but could use a helpful pointer. Thanks in advance.

Yes it's interesting I don't know a way of doing it in Excel because the concatenate function doesn't work with arrays, but you can do it in Google Sheets:-

=ArrayFormula(CONCATENATE(IF(B4:B7<>"",$A4:$A7&" ","")))

(this is almost what you want - uses a space instead of a comma as separator).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM