Using regexmatch to match part of a cell to values in a column to see there is a match - regex

I have a column (Column A) of cells with tracking information. Each cell contains the date shipped and a tracking number. I have another column (Column B) with a bunch of tracking numbers. How can I see if the tracking number in column B match any of the tracking numbers in Column A?
This is what I have tried:
=IF(RegExMatch(A1, TO_TEXT(B:B)),"YES","NO") but that's not working
All of the results are coming back as "YES" even though there is no match. Any thoughts on this?

=ARRAYFORMULA(IF(LEN(B:B), IF(IFERROR(VLOOKUP(""&B:B,
IFERROR(REGEXEXTRACT(A:A, TEXTJOIN("|", 1, B:B))), 1, 0))<>"", "YES", "NO"), ))

Related

Google Sheets - IF columns contains text and another columns contains number return total value of number column

I am trying to see if I am able to get the hours from one column only if it matches a word that is another column.
For example in the sheet link attached, if the word is Operations (Column A) I want to get the sum of all the hours (Column B) that correlate with that word.
https://docs.google.com/spreadsheets/d/1-1QCZsNTZ5xDcDryv8qg0YPtsoY3Erjz7ZNGUXds7HY/edit
Hope this makes sense.
Thanks in advance.
you can use:
=SUM(IFNA(FILTER(B:B,A:A=E1)))
OR
=SUMIF(A:A,E1,B:B)
Cell E1 has the word selection in the sample here

Highlight duplicates when part of the cell matches in Google Sheets

I have searched as much as I can, and I have found solutions for similar problems, but I haven't been able to find a solution to my exact problem.
Issue: I would like to highlight the row when one cell in column A of that row is an exact match for another cell in that column, AND part of another cell in column B of that row is a match for part of another cell in that column, in Google Sheets. I would like to use conditional formatting, and only highlight the second occurence and on.
For example, is this "sheet":
A B C
1|John Smith|john#test.com|Test Co.
2|Jane Doe |jane#x.com |X Company
3|John Smith|j.s#test.com |Test Inc.
4|John Smith|jsm#test.com |Test Incorporated
I would like row 3 and row 4 to highlight, because column A3 is a duplicate of A1, and everything in B3 after # matches everything in B1 after #, and the same is true of row 4. Also, only rows 3 and 4 should highlight; not row 1, since it is the first instance. I understand regexes, and I've found how to highlight a row if one cell in column A and one cell in column B is an exact match with other cells is their respective columns, but I haven't figured out how to combine the two where I can search for one cell that is an exact match with another cell in that column AND for one cell that is a partial match with another cell in that particular column. Here is a link to a test sheet that contains the sample info from above. https://docs.google.com/spreadsheets/d/1neZd213C1ssY7bPeBfu2xI3WPCmt-oKkfbdrXrid9I8/edit?usp=sharing
use:
=INDEX(COUNTIFS($A:$A&REGEXEXTRACT($B:$B, "#.+"), $A1&REGEXEXTRACT($B1, "#.+"),
ROW($A:$A), "<="&ROW($A1))>1)*(A:A<>"")
Try the following custom formula applied to A1:C:
=index((countif($A$1:$A1,$A1)>1)*
(countif(regexextract($B$1:$B1,"#(.*)"),
regexextract($B1,"#(.*)"))>1))

Count Number of Consecutive Occurrence of values in Google sheets

This is the original data, all the data are of two kinds: red and black. And then, I want to study the occurrence of all the blocks. The result will be like this:
It means the first streak of red(from index 1 to 3) has a length of 3, and the second streak which is black(from index 4 to 5) has a length of 2...
I want to find out an elegant way to calculate it but in sheets, it's very hard. COUNTIF and ROWS all can't perfectly resolve this problem.
Do you have an elegant way?
try:
=ARRAYFORMULA(QUERY(REGEXREPLACE(QUERY({TEXT(
VLOOKUP(ROW(B2:B20), QUERY((B2:B20<>B1:B19)*ROW(B2:B20),
"where Col1 <>0"), 1, 1), "000000")&"×"&B2:B20},
"select Col1,count(Col1) group by Col1 label count(Col1)''")&"", "(.+×)", ),
"where Col1 is not null"))
Not sure it's elegant, but you could add two helper columns, the first column checks if the record has changed, and the second counts until the next change using a MATCH. Note you'd need an extra "TRUE" below the last record to catch the last streak. Then you can use FILTER to show the blocks and occurances.

Use Conditional Formatting in Google Sheets to highlight cell

Problem
I want to be able to highlight a cell in google sheets if a cell on the same row is TRUE and the value does not exist in a named range (or a sheet).
e.g.
Based on the scenario below in sheet1, if column a is TRUE, and the value in column b does not match anything in sheet2, highlight the cell red.
sheet1
column a column b
TRUE value1
FALSE value2
sheet2
column a
value2
I would like to do this in google sheets using conditional formatting custom formulas and named ranges (if required).
Edit
I have tried this with my sheet but cant manage it... I have copied my sheet example below! Are you able to work it with this?
sheet1
sheet2
Edit 2
Rather than just matching whats in Cell D I would like to only match the values of the string that is separated by commas and only search if the letters "tf" are in the string.
if column a is TRUE, and the value in column b does not match anything in sheet2, highlight the cell red
try:
=(A1=TRUE)*(NOT(REGEXMATCH(B1&"", ""&TEXTJOIN("|", 1, INDIRECT("Sheet2!A:A")))))

Google Sheet Conditional Formula for IF function

Trying to make a Google Sheets Formula for Conditional Formula that when a cell in column "A" is equal to then change the background to red if Cell in the matching row in column "E" is empty
I started with REGEXMATCH but I couldn't figure out how to format it.
Basically, if the company's names match they require a PO# in which it would mark the cell red if not filled out
try:
=($A2<>"")*($E2="")
apply it on range A2:A