Forum Discussion
moncho47
Jun 06, 2020Copper Contributor
Excel formula - returning multiple text strings in a cell
Hi, Newbie here. Is have a cell that could contain apples and/or oranges and/or pears. I'm able to use an IF formula to extract either apples or oranges or pears but get a false value when the cell c...
- Jun 06, 2020
As variant if add list of possible variant in column O, and assuming your version of Excel supports TEXTJOIN,
in M2 is
=IF( LEN(TEXTJOIN(", ",1,IF(COUNTIF(B2,"*"&$O$2:$O$4&"*"),$O$2:$O$4,"")))=0, "apple", TEXTJOIN(", ",1,IF(COUNTIF(B2,"*"&$O$2:$O$4&"*"),$O$2:$O$4,"")) )
and drag it down.
mathetes
Jun 06, 2020Silver Contributor
Could you post a representative spreadsheet that illustrates what you're describing. One that works on the one hand, but not on the other. It's hard to diagnose without actually seeing and experiencing the reality, no matter how clear your description is (and it's pretty good)...
I do realize that your apples and oranges is meant as an example, but I'm having a hard time visualizing why you can make the one condition work, but not the other.