Formula to establish the sequence number within a string?

Roy Munson

New Member
Joined
Sep 23, 2011
Messages
2
Hello can somebody help me with this part of my formula, I thought it was just a simple IF(Find(Right)) formula but it returns a #Value!!!

=IF(FIND(">",(RIGHT(G7,2)),1)>0,RIGHT(G7,1),IF(FIND(">",RIGHT(G7,3),1)>0,RIGHT(G7,2),RIGHT(G7,3)))

G7 contains a manually entered sequence of numbers which are entered to instruct a user referring to process document they can be as greater than 100, each number in the sequence is separated by the ">" symbol. I need to capture the final number in the sequence then concatenate this number to establish a unique reference number , some examples below;

1>2>3>5>6 (using the formula above this sequence works and captures a 6)

1>10>21>28 or 1>10>55>101 anything with 2 or more digits at the end of the sequence returns a #value!

Any workable suggestions would be much appreciated!? As I tried a number of other formulas with no success!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

Not quite sure I understood your description. You mean you simply want the number after the final ">"? If so:

=TRIM(RIGHT(SUBSTITUTE(A1,">",REPT(" ",255)),255))

or

=--TRIM(RIGHT(SUBSTITUTE(A1,">",REPT(" ",255)),255))


if you wish the returned value to be numeric (so that you can e.g. perform further mathematical operations upon it).

Regards
 
Upvote 0
1>10>21>281
formula in cell returning 1 is
=FIND(">",RIGHT(C15,3))
this "tells" you that
the rightmost 2 characters are not ">"

<colgroup><col><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0
Hi,

Not quite sure I understood your description. You mean you simply want the number after the final ">"? If so:

=TRIM(RIGHT(SUBSTITUTE(A1,">",REPT(" ",255)),255))

or

=--TRIM(RIGHT(SUBSTITUTE(A1,">",REPT(" ",255)),255))


if you wish the returned value to be numeric (so that you can e.g. perform further mathematical operations upon it).

Regards

This is exactly what I was after thank you. Works a treat.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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