Find string

rpadminserver

Board Regular
Joined
Nov 7, 2007
Messages
111
Office Version
  1. 365
Hello All.

I have data in cells that look somthing like this -
SIG A Arm, AN 9.7

I trying to come up with a formula that find the last instance of "AN " (that is AN with a space)(and yes there could be another instance of "AN ", in the string, I only need to find the LAST instance) and give me remaining number.

In this example I would want 9.7 to appear in my cell.

Thanks all!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
...(and yes there could be another instance of "AN ", in the string, I only need to find the LAST instance) and give me remaining number.
Clarification please... will the last "AN " and the number that follows it always come at the end of the string like your example shows or could there be other text after it at the end of the string? If so, will there always be a space after the number for that case?
 
Upvote 0
Thank you all very much.

I have what I need

FYI....

Rick... my string will always end with AN ####, and there will never be another AN after that.
 
Upvote 0
Rick... my string will always end with AN ####, and there will never be another AN after that.
Actually, I was asking if "AN #.#" would always end your string. I wanted to make sure that you couldn't have something like this...

Text text AN 1.2 text text AN 9.7 more text at the end

If the number will always be at the end of the text, then you can use this formuls as well...

=LOOKUP(999,--RIGHT(A1,ROW(INDIRECT("1:99"))))

where the 999 must be a number larger than the largest number that can appear anywhere within the text. If you know that you will never insert any rows within the first 99 rows of your worksheet, the above formula can be made more efficient...

=LOOKUP(999,--RIGHT(A1,ROW($1:$99)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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