How to combine IF and FILTER formulas to copy text from one column to another

steviemb

New Member
Joined
Feb 22, 2024
Messages
2
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. MacOS
I am coding qualitative data from call center agent notes, and I'm trying to adapt another researcher's Excel method. I've adapted it a bit for my own purposes, and I just can't seem to get this last piece. I'm using Excel for Mac version 16.81

So, I have all my agent notes in Column A. In Column B, I have all the relevant tags for that note in a comma delineated list. I've created a unique list from all my tags (n=10) and turned them into headers in new columns. To organize the notes by tag, I want to copy the notes in Column A into Columns X-Z based on whether or not that note has a tag in Column B that matches the header of Column X-Z (see table below for simplified visualization).
NotesTagsXYZ
1 (note text)x, y11


This is the other researcher's code I'm trying to adapt: =if(X1<>"",filter($A:$A, $B:$B=X1,"")

I cannot get this code to work for me- partially because this researcher only has 1 tag in their Column B, whereas I have multiple in a comma delineated list. I've been successful with a code that searches text and moves row by row, but it leaves me with blank cells if the Column A note in that row doesn't have a tag corresponding to Column X-Z.

=IF(ISNUMBER(SEARCH(X$1,$B2)),$A2,"")

Visualization of what this returns
NotesTagsXYZ
1x, y11
2x, z22
3z3

But what I really want is a way to reference the entire Column A when I populate Column X so that there aren't empty cells. I've tried changing my formula to

=IF(ISNUMBER(SEARCH(X$1,$B:$B)),$A:$A,"")

but that just returns a Spillover error. How can I change my formula to get this
NotesTagsXYZ
1x, y112
2x, z23
3z
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Another option
Excel Formula:
=FILTER($A$2:$A$100,ISNUMBER(SEARCH(X$1,$B$2:$B$100)),"")
With any array formula it's best to avoid whole column references
 
Upvote 0
Solution
Another option
Excel Formula:
=FILTER($A$2:$A$100,ISNUMBER(SEARCH(X$1,$B$2:$B$100)),"")
With any array formula it's best to avoid whole column references
that worked brilliantly, thank you!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

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