Forum Discussion
miked2525
Oct 31, 2024Copper Contributor
Search for text within a cell and returning value based on what is found or leave the cell blank
I need to Search for text within a cell and returning value based on what is found or leave the cell blank if neither is found. Hello, I need to amend this example formula so if cell C3 finds "apple"...
m_tarler
Oct 31, 2024Bronze Contributor
=IF(ISNUMBER(SEARCH("apple",C3)),"$1",IF(ISNUMBER(SEARCH("orange",C3)),"$2",""))
OR
=IFS(ISNUMBER(SEARCH("apple",C3)),"$1",ISNUMBER(SEARCH("orange",C3)),"$2",TRUE,"")
OR
=IFS(ISNUMBER(SEARCH("apple",C3)),"$1",ISNUMBER(SEARCH("orange",C3)),"$2",TRUE,"")
- miked2525Oct 31, 2024Copper Contributor
Thank you! How do I add to this formula logic to return a blank (or $0) if neither apple or orange are a word in cell C3? m_tarler
- m_tarlerOct 31, 2024Bronze ContributorThat formula already returns "" (blank) if neither is found. HOWEVER "" is NOT truly BLANK in the sense if you try using ISBLANK() it will return FALSE since that cell may look blank it has a formula in it and returns an empty string value.
- miked2525Nov 01, 2024Copper Contributor
Hi!
What did I do wrong here? I'm looking to return one of these values based on cell V3 containing one of these words OR return a " " (blank) if none of these words are present in cell V3. I'm getting a "
=IF(OR(ISNUMBER(SEARCH("apple",V3)),"$1","",ISNUMBER(SEARCH("orange",V3))),"$2","",(ISNUMBER(SEARCH("banana",V3)),"$3","",ISNUMBER(SEARCH("grape",V3))),"4","")