Formula to read text then delete from table (Substitute?)

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
567
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a 3 column (10 rows) table with various and duplicated text. On the same spreadsheet I have a IF statement that based on a "Yes" or "No" it fills in data

in F1 I have =IF E1="YES","ABC","XYZ". So F1 will either fill with "ABC" or "XYZ"

What I am trying to happen is when either "ABC" or "XYZ" fills F1 I need all instances of that text deleted from the 3 column 10 row table.

Thank you,
James

1642178439401.png
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
How about
+Fluff 1.xlsm
ABCDEF
1ABCQRSABCABC
2123XYZDEF
3789ABCXYZ
4
5
6 QRS
7123XYZDEF
8789XYZ
Main
Cell Formulas
RangeFormula
A6:C8A6=SUBSTITUTE(A1:C3,F1,"")
Dynamic array formulas.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Doing something wrong. Getting Spill Error. I selected A6:C8 and entered the formula =SUBSTITUTE(A1:C3,F1,"") in cell A6 and this is what I get.


1642195334749.png
 
Upvote 0
Clear those cells & just put the formula in A6
 
Upvote 0
So I got the above to work and I thought my next task would be a simple revision but I was wrong. How do you make the formula work for multiple entries in column F? Meaning col F has 10-12 different data going down it and I need any data in the table matching any of the data in column F to be deleted.

Thanks again,
James
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEF
1ABCQRSABCABC
2123XYZDEFxyz
3789ABCXYZ
4
5
6 QRS
7123DEF
8789
9
Main
Cell Formulas
RangeFormula
A6:C8A6=IF(ISNUMBER(MATCH(A1:C3,F1:F2,0)),"",A1:C3)
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,591
Messages
6,120,428
Members
448,961
Latest member
nzskater

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