You're welcome, Pat.
For your new problem try:
=IF(CT89="apples",TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
SUBSTITUTE(SUBSTITUTE(" "&CX89&","&CZ89&","&DF89&","& DH89&
","& DN89&","&DP89&" ",",,,,",","),",,,",","),",,",",")," ,",""),",
","")),"")
Please notice, that I have added a space " " at each end of
your original string to catch a starting or trailing comma.