Repalce part of text

radosvep

New Member
Joined
Sep 20, 2014
Messages
2
Hi guys,

Can anyone help me how I can change part of text in a cell, for example

A1 :configure vlan port 1/1/5/1:1:32 protocol-group pppoe

using vlookup for matching of values, columns C and D

1/1/5/1 1/1/8/1
1/1/5/11 1/1/9/3

Results:
configure vlan port 1/1/8/1:1:32 protocol-group pppoe

Thank you in advance
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

djo5003

New Member
Joined
May 29, 2013
Messages
14
If the text is always constant:

=CONCATENATE("configure vlan port ",VLOOKUP(RIGHT(LEFT(A1,LEN(A1)-26),LEN(LEFT(A1,LEN(A1)-26))-20),$C$1:$D$2,2,FALSE),":1:32 protocol-group pppoe")

Or if relying on A1 for output:

=CONCATENATE(LEFT(A1,20),VLOOKUP(RIGHT(LEFT(A1,LEN(A1)-26),LEN(LEFT(A1,LEN(A1)-26))-20),$C$1:$D$2,2,FALSE),RIGHT(A1,26))
 

Watch MrExcel Video

Forum statistics

Threads
1,122,233
Messages
5,594,964
Members
413,955
Latest member
FalcoDaz

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
Top