Reputation: 21
I need a formula to write back a sequence of numbers in a comma separated value in a single cell. In the example below the formula would look at column A and find the reference 1, then search columns B to F and store the value. Then it would need to look back at column A and if it found the reference of 1 again and search column B to F again and add that value to the previous answer - all in one cell. Any ideas!?
Upvotes: 0
Views: 349
Reputation: 152450
You can use TEXTJOIN as an array formula, Put this in G2:
=TEXTJOIN(",",TRUE,IF(($A$2:$A$12=A2)*($B$2:$F$12<>""),$B$2:$F$12,""))
Confirm with Ctrl-Shift-Enter when exiting edit mode. then copy down.
TEXTJOIN was introduced in Office 365 and Office 19, if one does not have TEXTJOIN there is code Here that mimics the TEXTJOIN
Upvotes: 2