If you are using Office 365, you no longer need the if statements, you can just do the unique
=TEXTJOIN(", ",TRUE,UNIQUE(B4:B9))