Suppose you have been given a word say "and" and you need to find which word position is this
- In Mr. and Mrs. Smith – Position of "and" is 2 as this is the 2nd word, the position is not 5.
- In Samarand Smith and Kittie Smith – the position is 3 not 2 as "and" is appearing in the first word also but not as a single word.
You need to write a formula which finds the word position for the word "and"
Below is the test data.
Mr. and Mrs John Doe
The Reverend John Doe and Mrs. Jane Doe
and
Myranda and Lynda
Rama and
and rama
You can also download an Excel to work on this problem – Challenge 66 – Find the Position of Word
The solution to this challenge will be published after a month i.e. on 14-Nov-17.
Assuming your data in column A starting cell A1 then give this formula at B1 and copy it down.
=LEN(LEFT(" "&TRIM(A1)&" ",SEARCH(" and "," "&TRIM(A1)&" ")-1))-LEN(SUBSTITUTE(LEFT(" "&TRIM(A1)&" ",SEARCH(" and "," "&TRIM(A1)&" ")-1)," ",""))+1
Works well. This is an acceptable solution.