Forum Discussion
HOW TO: "If cell contains specific text display the immediate next word after it"
Hello, i don't know if im in a right thread since im new here and dont know how to post.
My problem is this
I want my result in column B will be like this it extracted the before the dash but if in column A dont have "-" it will return its original word
Regarding the thread (discussion), I would say "If in doubt, start a new thread (discussion). You can always include a link in your post that refers to the closely-related thread(s), if that is appropriate."
You don't say which Excel product you are using (Excel 365, Excel 2019, etc.). If you are using Excel 365 or Excel for the web, the new TEXTBEFORE function handles this nicely:
=TEXTBEFORE(" - ", A1)
(Most spaces in my formulas are optional; I include them for improved readability. But in this case the spaces around the hyphen are appropriate.) Change the A1 reference if appropriate, and copy the formula down as needed.
If you are using an older Excel product, this see the attached workbook.