Nov 07 2023 11:09 AM
consolidated | city | first | last |
tampa | matthew | sanders |
How do I write an "if" statement for column A that returns all 3 of the words consolidated if the second two are what I am looking for?
I want column A to show, tampamatthewsanders if column B is "tampa" and column C is "matthew" and column D is "sanders" but if Column D is anything other than "sanders" I want column A to read tampamatthew only.
Nov 07 2023 11:51 AM
If I understand fully what you want -- you didn't specify what is to happen if B2 or C2 are something other than "tampa" or "matthew" -- this formula will work. In that non-specified situation, I wrote a formula that returns blank.
=LET(FstTwo,AND(B2="tampa",C2="matthew"),Thrd,D2="sanders",IFS(AND(FstTwo,Thrd),B2&C2&D2,FstTwo,B2&C2,NOT(FstTwo),""))
Nov 07 2023 11:57 AM
@pssmatthewsanders By the way, because I used a LET function, you will need a relatively recent version of Excel for that to work.
If you don't have that new version, this will work:
=IFS(AND(B2="tampa",C2="matthew",D2="sanders"),B3&C3&D3,AND(B2="tampa",C2="matthew"),B3&C3,NOT(AND(B2="tampa",C2="matthew")),"")
Nov 13 2023 09:51 AM