简体   繁体   中英

comparing two columns with the similar strings on google sheets and use conditional formatting

I have two columns that I am trying to compare.

Column 1:
StudentaY-REV
StudentbY-REV
StudentcY-REV 

Column 2:
Studenta
Studentz
Studentk
Studento

I want to output a true/false statement, based on whether the substrings in column 2 can be found in column 1 as well. Column 2 is my master sheet and I want to add conditional formatting that colors those cells that could be found in Column 1. Is this possible? I've tried regexmatch, maybe a better approach would be to somehow compare the lengths of strings since Y-REV concat is standard in Column 1. I wrote a function that concatenated them because I thought it would be easier to do this next step if so.

try:

=ARRAYFORMULA(IF(A1:A="",,IF(IFERROR(REGEXEXTRACT(A1:A, 
 TEXTJOIN("|", 1, B1:B)))="", FALSE, TRUE)))

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM