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
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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))
 
Upvote 0

Forum statistics

Threads
1,202,909
Messages
6,052,495
Members
444,587
Latest member
ezza59

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