Try this approach

Select D2:Z2 and paste the following array formula (CSE --> CTRL+SHIFT+ENTER)
Formula: copy to clipboard
=IFERROR(1/AGGREGATE(14,6,1/(--(LEN(C2)>LEN(SUBSTITUTE(C2,$A$2:$A$9,ROW($A$2:$A$9))))*ROW($A$2:$A$9)),COLUMN(A$1:Z$1)),"")

and copy select cells (D2:Z2) down

Note: You can extend the number of columns to the maximum number of dependents COLUMN(A$1:Z$1)

See the file flow chart spread sheet sample.xlsx