Forum Discussion
pssmatthewsanders
Nov 07, 2023Copper Contributor
If/and/or question
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 look...
mathetes
Nov 07, 2023Silver Contributor
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),""))
mathetes
Nov 07, 2023Silver Contributor
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")),"")