conditional find text - rearrange text (formula)

spurtniq

New Member
Joined
Nov 15, 2003
Messages
27
in cell A2 is text

aaa

(length will vary)

OR

aaa/bbb/ccc

IF is found text

/bbb/

in cell B2

I want a formula that will conditionally concatenate:

aaa.ddd.com/bbb/ccc

otherwise text will be:

aaa.ddd.com

where ".ddd.com" (minus quotes) is a constant stored elsewhere
(say cell "D2") for this example.

Make sense?

Thanx
 
Last edited:
You could utilise this into a formula. it will return the text to the left of the first /. If no / is found it returns the cells value. Getting closer?

=IF(FIND("/",CONCATENATE(A2,"/"))<=LEN(A2),MID(A2, 1, FIND("/",A2)-1),A2)

Tried this. It gave me the text to the right.

1) Easiest method I've come up with is to add a delimiter "#" using most any text editor
with search and replace
2) Copy / Paste the edited text into a spreadsheet
3) Convert Text to Columns at the delimiter "#"
4) Then apply the concatenation and constants

This formula worked for me:

=IF(ISNUMBER(SEARCH("/tagged/",B2)),A2&$F$4&B2, A2&$F$4)

with the constant

.linkedin.com ($F$4)

and

mysite

in A2 (no "/tagged/")

becomes

mysite.linkedin.com

anothersite/tagged/today

or converted, delimited (#), text to columns:

anothersite#/tagged/today

becomes

anothersite (A2)

/tagged/today (B2)

and by my formula

anothersite.linkedin.com/tagged/today

tain't pretty, but, it works.

Once I've got it setup as a template, in just a few minutes I can convert
several links quickly, easily.

Hope it proves useful / helpful.

Thanx
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Does this formula (copied down) do what you want?

Or do you only want the D2 value included if there is a particular text after the / (eg tagged)?

If the formula below does not do what you want, please just list the exact values you would want returned in B2:B6 for my sample data in column A.

Excel Workbook
ABCD
1
2aaaaaa.ddd.com.ddd.com
3aaa/bbb/cccaaa.ddd.com/bbb/ccc
4anothersite/tagged/yesterdayanothersite.ddd.com/tagged/yesterday
5xyzxyz.ddd.com
6mysite/tagged/Tuesdaymysite.ddd.com/tagged/Tuesday
7
Insert Text
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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