BiggusDoggus
Board Regular
- Joined
- Jul 7, 2014
- Messages
- 91
- Office Version
- 365
- Platform
- Windows
Hi
I have had a good read of previous threads and can't find what I'm after...
I have a column of company names - column M.
Column X, I have =LEFT(M2,FIND(" ",M2)-1), which is fine, brings back first word in the company name.
Column Y, I need to extract the second word in the name - I'm using =MID($M2,FIND(" ",$M2,1)+1,FIND(" ",$M2,FIND(" ",$M2,1)+1)-(FIND(" ",$M2,FIND(" ",$M2,1))), which is also fine....so long as the company name is more than 2 words long!
For example, ABC Ltd isn't bringing back Ltd, it's #VALUE!. I'm assuming it's because there isn't actually a "mid"?
What I need is a formula that brings back the second word regardless of how many words in the name. Or, in case of error, bring back the last word, otherwise the second word. Either would be fine.
I've tried =IFERROR((TRIM(RIGHT(SUBSTITUTE($M2," ",REPT(" ",255)),255))),MID($M2,FIND(" ",$M2,1)+1,FIND(" ",$M2,FIND(" ",$M2,1)+1)-(FIND(" ",$M2,FIND(" ",$M2,1)))) - however, it appears #VALUE! isn't in fact an error, so it only ever brings back the final word.
Can anybody assist please...many thanks!
I have had a good read of previous threads and can't find what I'm after...
I have a column of company names - column M.
Column X, I have =LEFT(M2,FIND(" ",M2)-1), which is fine, brings back first word in the company name.
Column Y, I need to extract the second word in the name - I'm using =MID($M2,FIND(" ",$M2,1)+1,FIND(" ",$M2,FIND(" ",$M2,1)+1)-(FIND(" ",$M2,FIND(" ",$M2,1))), which is also fine....so long as the company name is more than 2 words long!
For example, ABC Ltd isn't bringing back Ltd, it's #VALUE!. I'm assuming it's because there isn't actually a "mid"?
What I need is a formula that brings back the second word regardless of how many words in the name. Or, in case of error, bring back the last word, otherwise the second word. Either would be fine.
I've tried =IFERROR((TRIM(RIGHT(SUBSTITUTE($M2," ",REPT(" ",255)),255))),MID($M2,FIND(" ",$M2,1)+1,FIND(" ",$M2,FIND(" ",$M2,1)+1)-(FIND(" ",$M2,FIND(" ",$M2,1)))) - however, it appears #VALUE! isn't in fact an error, so it only ever brings back the final word.
Can anybody assist please...many thanks!