Originally Posted by
bebo021999
Try:
=IF(B2="","","Hat, ")&IF(C2="","","Leather jacket, ")&IF(D2="","","Gloves, ")&IF(E2="","","Boots, ")
If more than 4 items, VBA is best choice.
This worked great, however it leaves a trailing comma. Not a real big deal but I thought I'd try to avoid it. I found a custom function that worked great within the cell, however if there is nothing then it throws an error.
Works like this:
Public Function RemoveLastChar(rng As String, cnt As Long)
RemoveLastChar = Left(rng, Len(rng) - cnt)
End Function
So then we have:
=RemoveLastChar(IF(B2="","","Hat, ")&IF(C2="","","Leather jacket, ")&IF(D2="","","Gloves, ")&IF(E2="","","Boots, "),2)
This all works great until there is nothing in the cell. Then I get the #VALUE! error. Anyone have an idea how to fix this from happening?
Bookmarks