Remove a string based on other column value

andranos

New Member
Joined
May 28, 2014
Messages
9
Hey guys,

Need some help with deleting a value using other cell value as a reference
For example:

Column A, Column B, Result
Random1, I Love Random1 Apple, I Love Apple
Apple, Apple is Sweet, is Sweet

More or less like that
Thanks in advance guys
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try:


Excel 2012
ABC
1Column AColumn BResult
2Random1I Love Random1 AppleI Love Apple
3AppleApple is Sweetis Sweet
Sheet1
Cell Formulas
RangeFormula
C2=SUBSTITUTE(B2,A2,"")
 
Upvote 0
Try:

Excel 2012
ABC
1Column A Column B Result
2Random1 I Love Random1 Apple I Love Apple
3Apple Apple is Sweet is Sweet

<colgroup><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C2=SUBSTITUTE(B2,A2,"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
Maybe wrapping a TRIM function around that would be useful...

=TRIM(SUBSTITUTE(B2,A2,""))
 
Upvote 0
Try:

Excel 2012
ABC
1Column A Column B Result
2Random1 I Love Random1 Apple I Love Apple
3Apple Apple is Sweet is Sweet

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C2=SUBSTITUTE(B2,A2,"")

<tbody>
</tbody>

<tbody>
</tbody>

Works like a charm
There's another problem though
Here's an example

Excel 2012
ABC
1Column A Column BResult
2LoveI Love Apple LoveI Love Apple
3AppleApple is Sweet AppleApple is Sweet


<tbody>
</tbody>

<table cellpadding="2.5px" rules="all" verdana,="" arial,="" tahoma,="" calibri,="" geneva,="" sans-serif;="" border:="" 1px="" solid="" rgb(187,="" 187,="" 187);="" border-collapse:="" collapse;"="" style="width: " width=""><colgroup><col><col><col><col></colgroup><thead></thead><tbody></tbody></table>

I need to remove the duplicated keyword based on column A value and the latest one will be deleted
And the condition only applies if the keyword from column A is duplicate in column B. If it's not, leave it as it is
Is that possible?

Cheers
 
Last edited:
Upvote 0
Try:

Note addition of the "2" as an additional argument at the end. This instructs excel to "START" the search AFTER finding number 1 (the first instance). Hope that helps. Jim


Excel 2012
ABC
1Column AColumn BResult
2LoveI Love Apple LoveI Love Apple
3AppleApple is Sweet AppleApple is Sweet
4SourApple is Sweet AppleApple is Sweet Apple
Sheet1
Cell Formulas
RangeFormula
C2=SUBSTITUTE(B2,A2,"",2)
 
Upvote 0

Forum statistics

Threads
1,214,849
Messages
6,121,925
Members
449,056
Latest member
denissimo

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