Search for Multiple Substring Possibilities in a Column: Google Sheets - search

Column A contains roughly 3,000 cells with long text strings in each. Somewhere in those long text strings are names listed in Column C (~800 names).
I am attempting to write a formula that will search each cell in column A for one of those names in column C. When it finds one of those names, it should pull that name into column B.
Here is a link to an example in Google Sheets.
https://docs.google.com/spreadsheets/d/1O87OkQdkfSo5N8WjiqcL5YZfLiyaeds3YAXclVQS_2Q/edit#gid=0
Any help is appreciated, thank you.

You can use this formula in each row of column B. Keep in mind that you should have good (well structured) data in column A. As the formula searcheds for the substring that comes between "Name=" and "," to find a match in the NameList list.
=VLOOKUP(index(split(index(Split(B3,"Name=",FALSE),2),",",FALSE),1),NameList!A2:A,1)
References:
VLOOKUP

Related

Matching up information on Excel from 2 different sheets

In the next step of the analysis I'm currently working on I have one sheet with two important columns. Column A specifies gene name and Column B specifies a number I am interested in (first screenshot). Then, I have a second sheet that repeats Column A but the gene name entries are in a different order to the first sheet and a Column B which has a lettered classification system (A-Z) which gives me some detail regarding the function of that gene. I would like to match the Column A and Column B data from sheet 1 to the Column B data from sheet 2 but as the column A in both sheets is the same but in a different order, is there a way to get Excel to match the correct letter in the second sheet to the correct gene name and number in the first sheet? The screenshots are of fake test data just to help me clarify this text! Any help really appreciated.
Use Index/Match() like below-
=INDEX(Sheet2!$B$2:$B$20,MATCH(A2,Sheet2!$A$2:$A$20,0))
VLOOKUP() will also work
=VLOOKUP(A2,Sheet2!$A$2:$B$20,2,FALSE)
If you have Excel365 then use XLOOKUP() function.
=XLOOKUP(A2,Sheet2!$A$2:$A$20,Sheet2!$B$2:$B$20,"Not Found")

How can I find rows in Excel that have matching cells in the same rows as well as cells in these rows that do not match each other?

Say I have a list of peoples' addresses, names, and genders and I want to find the heterosexual couples that live together. Each person represents a row in Excel. I first want to find people whose addresses match each other. Then I need to filter by male and female "rows" with the same addresses.
I can filter for duplicates, and get the matching addresses lined up, but how can I perform the second goal of matching only different-gender couples? Thank you!
insert a column named id and a column named id_match, like the image. put this formula in E2 and fill down formula to all cells:
=IFERROR(INDEX($A$1:A1;MATCH(A2;$E$1:E1;0));IFERROR(INDEX($A$2:$A$11;MATCH(1;INDEX(($A$2:$A$11<>A2)*($C$2:$C$11<>C2)*($D$2:$D$11=D2);0;1);0));"match not found"))
also you can set this formula in cell F2 to find match name:
=IFERROR(INDEX($B$2:$B$11;MATCH(E2;$A$2:$A$11;0));"")

Using two values in a sheet to filter and return values from a table in another sheet

I'm fairly new to coding and i've been googling around for the last few hours trying to solve this problem but it seems to be a little beyond what i'm able to do so i would be very grateful for some help
In Sheet1, I have a table which has columns between M - CV (175 columbs). For each column, i have an "ID number" value in row 3. From Row 6 to the end of the table, i have several "search terms" separated by commas in the column CV
In Sheet2, the corresponding "ID Numbers" are in column B. Column AN contains strings.
For each ID Number value in sheet1, i'm looking to find find all the corresponding cells in sheet2 where the ID number in Column B is the same, and Column AN of sheet2 contains at least one of the "search terms" in column CV
For each ID number, i'm hoping to join the entries in Column AN of sheet2 which match the criteria above and paste them into Row 5 of the respective column in Sheet1
I've gone around in quite a few circles trying to do this and i'm back to square 1 with no code to show for it.
I've tried to research both the autofilter function, and using for loops. The research i've done indicates that for loops are rather slow to run for a large data set.
I'm hoping to find a solution which is as easy to read and understand as possible
I hope i've given enough information for everyone to understand and help
THank you in advance
My Excel subscription has expired an I've started using Google Sheets for most of my spreadsheet work, so I tested this there. Some conversion may be required. I did this using formulas, not VBA also, not sure if that changes things for you.
If I understand correctly, you have two sheets with a shared key column, sheet 1 contains search terms across multiple columns, and sheet 2 contains search terms comma delimited in a single column.
With this setup we want to bring the search term column of sheet 2 into the correct row of sheet 1 by key using VLOOKUP. I made a named range in sheets which contained all my data on sheet 2 and called it "dst". My formula was then =VLOOKUP(A2, dst, 7, true) since my key in sheet 1 was in column A, dst was the range I was searching, my column with my delimited search terms was column 7 in relation to dst, and I had ordered sheet 2 by key. I pasted this formula relatively down all rows as needed.
We want to construct a regex string using our search terms across multiple columns in sheet 1, into a single cell. I used =JOIN("|", B2:E2) on sheet 1 since my search terms were in columns B:E, and this resulted in a regex that looked like this for me: alligator|dog|rabbit|lizard where alligator, dog, rabbit, and lizard, were all search terms in that row. Paste down relative as needed.
We want to run our regex against our search target cell containing the comma delimited search terms. I ran =REGEXMATCH(F2, G2) where F2 was my delimited search terms from sheet 2, and G2 was my constructed regex for the row. Paste down relative as needed.
A screenshot of my completed sheet 1:
Once you know which cells have matches you can do whatever you want.

Excel formula to count discrete instances of referenced cells

I have a column of strings, representing names, where there can be more than one name per cell and each is separated by a semicolon. There is a column next to it that has a single character which represents a category. To illustrate:
My desired outcome is shown in the second box. What I need is a formula that, for each name in column B, counts up how many instances of the categories in column C were assigned to it.
I'm having difficulty reconciling the fact that there may be multiple names in each cell in column B. Can anyone think of an easy approach here?
Just use COUNTIFS and wildcards:
=COUNTIFS($B$2:$B$5,"*"&$G3&"*",$C$2:$C$5,H$2)

EXCEL: Count values in column based on values in corresponding column

I feel like this should be really easy, but I can't figure out the commands.
I have data in columns C and D which either contains a date or is blank. I have data in column H which contains the name of an employee. I want to calculate the total number of times, for each individual employee, non-blank values occur in C and non-blank values occur in D.
CountIf doesn't quite seem to have the capacity to do this. Any ideas?
In addition to previos answer, if your criteria is for non-blank cells:
=COUNTIFS(H:H,"YourName",C:C,"<>"&"",D:D,"<>"&"")
If you are using Excel 2007 or later, use
=COUNTIFS(H:H,"YourName",C:C,"",D:D,"")

Resources