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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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
[TABLE="width: 356"]
<colgroup><col><col><col span="3"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1>10>21>28[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]formula in cell returning 1 is[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]=FIND(">",RIGHT(C15,3))[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]this "tells" you that[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 3"]the rightmost 2 characters are not ">"[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
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,223,272
Messages
6,171,112
Members
452,381
Latest member
Nova88

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