B25 contains a formula which extract the last word of a string on A25.
I don't understand the logic of that.![]()
B25 contains a formula which extract the last word of a string on A25.
I don't understand the logic of that.![]()
It's probably best to keep to your first thread, as these queries are related: http://www.excelforum.com/excel-form...om-a-path.html
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
Hi
I use this similar formula
Formula:
=IFERROR(MID(A25,FIND(CHAR(7),SUBSTITUTE(A25," ",CHAR(7),LEN(A25)-LEN(SUBSTITUTE(A25," ",""))))+1,255),A25)
instead
Formula:
=IF(ISERR(FIND(" ",A25))*LEN(A25)-LEN(SUBSTITUTE(A25," ",""))=0,A25,RIGHT(A25,LEN(A25)-FIND("*",SUBSTITUTE(A25," ","*",LEN(A25)-LEN(SUBSTITUTE(A25," ",""))))))
to be more streamlined, although the principle is similar
The formula use the following
1) Count the number of spaces :: LEN(A25)-LEN(SUBSTITUTE(A25," ",""))
2) Substitute the last space by a char not usualy used (example CHAR(7) or "*") :: SUBSTITUTE(A25," ",CHAR(7),LEN(A25)-LEN(SUBSTITUTE(A25," ","")))
3) Locate that character (CHAR(7)) in the string :: FIND(CHAR(7),SUBSTITUTE(A25," ",CHAR(7),LEN(A25)-LEN(SUBSTITUTE(A25," ",""))))+1,255)
4) Get the substring starting at that position :: MID(A25,FIND(CHAR(7),SUBSTITUTE(A25," ",CHAR(7),LEN(A25)-LEN(SUBSTITUTE(A25," ",""))))+1,255)
5) On error returns the same string IFERROR(....;A25)
Regards
This is a duplicate post(2ND FOR THIS SUBJECT) and as such does not comply with Rule 5 of our forum rules. As you have replies in both of your threads i'll merge these 2 threads.
Regards
Fotis.
-This is my Greek whisper to Europe.
--Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Advanced Excel Techniques: http://excelxor.com/
--KISS(Keep it simple Stupid)
--Bring them back.
---See about Acropolis of Athens.
--Visit Greece.
Isn't there a function which find the position of specified occurance of a character?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks