Finding and listing matching text in Google Sheets - google-sheets

I'm no sheet wiz. What I'm looking for is a formula that can make this happen.
I have a list of prohibited terms in Column C to E.
Cell B1 has a 200-character paragraph that I need to audit.
What I'm looking for is for Cell A1 to list all the words found in that paragraph that matches any prohibited term in Column C to E.
Again, I'm no wiz. Tried looking online for solutions but I can't seem to find something close to what I'm looking for.

You can try with this formula that filters depending in if the words are found:
=FILTER (FLATTEN (C:E),FLATTEN(C:E)<>"",REGEXMATCH(B1,"\b(?i)"&FLATTEN(C:E)&"\b"))
\b allows to find complete words, and (?i) to make it case insensitive

Related

Search in a list and replace from a list but with exact match

In Sheet1 A1:A I have a list of words. In Sheet2 A1:A I have a list with search terms. I now want to match each cell in Sheet1 to see if it contains words from the list of search terms. If yes, then the the words that matches inside the cell should be removed.
I have tried the following formulas, unfortunately without success.
=ArrayFormula(regexreplace(A1:A;Sheet2!A:A;""))
=substitute(A1;Sheet2!A$1:A;"")
The formula mentioned in the post Using multiple SUBSTITUTE functions dynamically does not working for me because I need an exact match regexreplace.
=ArrayFormula(IF(LEN(A2:A), REGEXREPLACE(A2:A, TEXTJOIN("|", 1, B2:B),),))
This will also remove the words from words that are part of words. for example, not only the word apple will be deleted, but also the word apple from appletree, which is not supposed to be.
Maybe try
=ArrayFormula(IF(LEN(A2:A), REGEXREPLACE(A2:A, "\b("&TEXTJOIN("|", 1, B2:B)&")\b",),))
and see if that helps?

Matching Columns From Different sheets

There are many similar questions on here but I can not find the answer I am after.
I am working in Google Sheets and need to write a conditional formatting equation that will highlight the B:C columns if they match an entry on the second sheet in the B:C columns. I do not know any search criteria past that which is where I keep running into an error. All the other questions here know what they are searching for. My work is fluid and new entries come in that may match an old one and I need to know that!
I use this formula on the first sheet to match entries specifically on the first sheet,
=COUNTIF(ARRAYFORMULA($B$3:$B$389&$C$3:$C$389),$B2&$C2)>1
This formula works great. If Lexington, SC is in row 2 and Lexington, SC is added again later in row 100, BAM they both light up red. Love that. The second equation I need is not so simple.
my data is:
SHEET 1 - Column B and Column C
County
State
Lexington
SC
Douglas
KS
Chase
KS
Clay
OH
Greenwood
NY
SHEET 2 - Column B and Column C
County
State
Saratoga
NY
Douglas
KS
Chase
KS
Clay
OH
Greenwood
SC
In this example above, I need the new formula to highlight Douglas KS, Chase KS, Clay OH on sheet one, because these three counties exists on Sheet Two.
I have tried MATCH, INDEX, VLOOKUP, etc. I keep running into an issue when I want TWO columns to be compared to TWO columns. It needs to be county name AND state.
Thank you to the community for any help you can give. I will provide more information if it is needed! I think this sums up my issue though.
QUERY ATTEMPTS
=COUNTIF(ARRAYFORMULA($B$2:$B$20&$C$2:$C$20),$B2&$C2)>1
=COUNTIF(ARRAYFORMULA('Sheet 2'!$B$2:$B$20&$C$2:$C$20),$B2&$C2)>1
=COUNTIF(ARRAYFORMULA(indirect("Sheet1!$B$2:$B$C$2:$C"),indirect("Sheet2!$B2:$B&$C2:$C")))>1
=ARRAYFORMULA(IFERROR(VLOOKUP(B2:C,"Sheet 2!$B2:$C",2, FALSE),""))
=ARRAYFORMULA(INDEX(B2:B19, MATCH(1, FIND(E2, C2:C19)), 0))
=ARRAYFORMULA(INDEX(B2:C,MATCH(indirect("Sheet 2!$B2:$C"),0)))
=MATCH($B2&$C2,indirect('Sheet 2'!$B2:$B&'Sheet 2'!$C2:$C"),0)
=MATCH($B2,indirect("Sheet 2!$B2:$C"),0)
=MATCH("Sheet 1!$B2&$C2",indirect("Sheet 2!$B2:$C"),0)
=MATCH("Sheet 1!$B:$C"),indirect("Sheet 2!$B:$C"),0)
=MATCH((B2&C2),indirect("Sheet 2!(B2&C2)"),0)
=INDEX($B2:$C2,MATCH($B2&$C2,indirect("Sheet 2!$B2:$C"),0)
=INDEX(B:C,MATCH($B2&$C2,indirect("Sheet 2!$B2:$C"),0)
=INDEX(B2:C710,MATCH(0,(B:C="Sheet 2!$B:$C"),0))
The only query I have gotten to work only works on the B column
=match($B2,indirect("Ready to Start!$B2:$B"),0)
in conditional formatting (and data validation) whenever you want to refer to another sheet, that sheet's range needs to be INDIRECTed. if you got a joint range (like you do) both of them need to be wrapped in INDIRECT
try:
=COUNTIF(ARRAYFORMULA($B$3:$B$389&$C$3:$C$389),
INDIRECT("Sheet 2!B2")&INDIRECT("Sheet 2!C2"))>1
or:
=COUNTIF(ARRAYFORMULA(INDIRECT("Sheet 2!B3:B389")&INDIRECT("Sheet 2!C3:C389")),
$B2&$C2)>1
but note that this will work only if let's say B4&C4 on BOTH sheets are the same.
if one sheet compared to other has different sorting of the same values you will need a completely different formula...
if your sheets are named exactly:
Sheet 1
Sheet 2
try this in Sheet 1:
=($A2<>"")*REGEXMATCH($A2&$B2, TEXTJOIN("|", 1,
INDIRECT("Sheet 2!A2:A")&INDIRECT("Sheet 2!B2:B")))

Google Sheets - Indicate which cells sum a value

Sometimes we have customers that, when they pay their EOM account, they pay more or fewer invoices than needed and do not provide a remittance. This makes figuring out which invoices they've paid difficult/time-consuming.
I'm looking for a formula or script that will, for example, look through column A (invoice values) and then highlight or place an X in column B next to the ones that add up to (or closest without going over) a total invoice value in cell C2.
I've been trying to work this out, but nothing is working...
So if C2 is going to be constant, (all rows) you could use a vlookup to find the difference of $A and $C$2.....
Wrapped in an IF to print X if found.....
Wrapped in an IFERROR to remove the #n/as...
So I got
=IFERROR( IF($A2+( VLOOKUP ($C$2-$A2:$A:5,1,false))=$C$2, "X", " "))
And someone smarter than me could probably wrap that in an array formula, but it will work with autofill.

Error when using match and indirect in Google Sheet

I have to make a conditional formating formula with cross-sheet references.
Basically I have many sheets, one with existing words, and another one with words we have to add. I want to highlight in "Feuille 6" the words that are already in "Existant". I tried many formulas, I read the doc, I still can't figure it out.
Quick edit : equiv = match, and ligne = row, it's just google sheet translating words into French..
Here's the formula I think I should use, but it's not working
=EQUIV(A,indirect("Sheet1!A"&LIGNE()))
Here's what the Feuille 6 looks like
Again, there should be highlighted words in Feuille 6, like " Action ", which already exists in the sheet " Existant ".
I tried replacing "Sheet1 "with "Existant" too.
Any tip please?
Thanks !
Try:
Assuming the sheet Existant has values in columns A to Z , and you are highlighting cells in column A
=countif(indirect("Existant!A:Z"), A1)

Using IF to return cell contents in Google Sheets

Edit for clarity:
The end result that I'm looking for will pass the name picked from the dropdown list in B1 into formulas below to check if each student has completed the training modules listed. The two sheets I'm looking at (for now) are 'Data' and 'Quick Reference' the rest are just placeholders.
I've looked and not found an answer so apologies if this has been asked before!
I'm trying to write a formula that will check form results and if it finds a match, return the contents from another column in that row.
The logical IF function works fine with hard coded entries, but not with cell contents.
So if I'm looking for "Deckhand USS Minnow I" I want to show the contents of Column H. Look on the Data and Quick Reference (Training Progress) tabs to see what I'm talking about.
This works:
=IF(((VLOOKUP($B1,Data!C2:J20,4)="Build Coconut Phone I")),"Yes", "No")
This doesn't:
=IF(((VLOOKUP($B1,Data!C2:J20,4)="Deckhand USS Minnow IV")),Data!H2:H20)
Google spreadsheet
Short answer
Use QUERY() instead of IF(Vlookup(),)
=QUERY(Data!C1:J20,"Select H where F = 'Deckhand USS Minnow IV'",1)
Explanation
While could be possible to use an array formula using IF and VLOOKUP, QUERY() does the work in a direct and simple way.
The formula in the short answer will include the column heading. If you don't want it use
=QUERY(Data!C2:J20,"Select H where F = 'Deckhand USS Minnow IV'",0)
References
QUERY - Google Docs editors Help

Resources