Excluding text before character

shedboyxx

New Member
Joined
Apr 13, 2011
Messages
11
Hi folks,

I have a feeling this is simple but I’m coming up blank. I have a field that contains text separated by backslashes. The number of backslashes are always the same

example 1
info1\info2\information3\info4\info5\here's what I want to exclude

I’m looking for a calculation that gives me all of the text that happens before the 5<sup>th</sup> occurrence of a backslash.

example 2
info1\info2\information3\info4\info5

I tried using Find, Right and Left in different combinations but failed

Let me know if you have something that will work.

TIA

Jim
 
The ^ symbol is typically used in math to mean "to the power of".

For example:

10^3 means 10 to the 3rd power or 10 * 10 * 10 = 1000

We can express that in a formula:

=10^3
Just to add...

You may be wondering why we used that character?

We used it because there is probably a very good chance that the data you're dealing with DOES NOT CONTAIN that character.

What the formula does is it finds that 5th slash and replaces it with the ^ symbol. Then we use the ^ symbol as a unique marker to tell us where we need to parse the sting.

So, it's important to use a symbol(s), which can be any symbol(s), that will be unique to the string being examined.

Edit: symbol(s) can also mean character(s).
 
Last edited:
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

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