r/excel•
cnuthead

RIGHT Formula Assistance: Last occurrence of the delimiter

solved

Hi all,

I have a column of data that is similar to the below (complete dummy data), and I need to be able to extract everything after the last delimiter. In this example, I need to extract the B101-TRT-R01 and E44-INI-F01.

XXXn – City/External/1/B101-TRT-R01

XXXn – City/Building n C/D/1/E444-INI-F01

I have found a formula that does work for some, however, not for all and I cannot for the life of me figure out why. there are no patterns that I can see.

=RIGHT(C2,LEN(C2)-SEARCH("$",SUBSTITUTE(C2,"/","$",LEN(C2)-LEN(SUBSTITUTE(C2,"/","")))))

I got this formula from https://www.ablebits.com/office-addins-blog/2017/01/31/excel-right-function-formula-examples/

With the examples above, 1 does work and 1 returns #VALUE

Works XXXn – City/External/1/B101-TRT-R01

Does Not Work XXXn – City/Building n C/D/1/E444-INI-F01

Not all of the values are the same, and not all of them contain -. some have spaces. it feels completely random when looking at the data set, however, I know that they are not random.

0365 EXCEL Desktop Version

Posted Mar 26, 2021, 12:09 AM UTC

36
Way2trivial84•

it works on both for me...

4
cnutheadOP•

SOLUTION VERIFIED

2
cnutheadOP•

yikes, Ive had a shocker here. I was using the wrong cell (c2) where some of the details were filled out, and some where not. Needed to be using A2. your comment made me go back with fresh eyes haha

3
Clippy_Office_AsstMOD•

You have awarded 1 point to Way2trivial

^I ^am ^a ^bot, ^please ^contact ^the ^mods ^with ^any ^questions.

1
cnutheadOP•

Forgot to say thanks :)

1
AutoModeratorMOD•

u/cnuthead - Your post was submitted successfully.

Please read these reminders and edit to fix your post where necessary:

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1