Find last character within text (search right to left)

Midsy

New Member
Joined
Aug 18, 2008
Messages
6
Hello,

I would like to search from right to left within a cell to find the "last" position of a character. The character might appear any number of time, hence find() is not good because I can't be sure how many times it will appear.

Eg Find the position of "." if the following text were in a cell:

Hello. I'm Peter. Welcome.

How do I find the position of the third "."?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Midsy

Welcome to the MrExcel board!

This will give an error if there is no "." in the cell, but see if it is any help. The "@" needs to be some character that will not occur in your cells.

Excel Workbook
AB
1Hello. I'm Peter. Welcome.26
2Hello. Goodbye6
Last Pos
 
Upvote 0
Peter,

Thank you very much. I can cover the error problem with iserror().

Funny, I thought there would be a function for searching in the reverse order, it just seems so needed.

Love ya work.

Mids
 
Upvote 0
Peter,

Thank you very much. I can cover the error problem with iserror().
Or maybe:
=IF(ISNUMBER(FIND(".",A1)),FIND("@",SUBSTITUTE(A1,".","@",LEN(A1)-LEN(SUBSTITUTE(A1,".","")))),"")
 
Upvote 0
Cheers again Peter,

You have improved on my function - which was:
=IF(ISERROR(FIND("@",SUBSTITUTE(A1,".","@",LEN(A1)-LEN(SUBSTITUTE(A1,".",""))))),"Not Code",FIND("@",SUBSTITUTE(A1,".","@",LEN(A1)-LEN(SUBSTITUTE(A1,".","")))))

You have earned your surf today!
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,821
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top