Google Sheet REGEXMATCH function case insensitive - google-sheets

I am using below formula:
=ARRAYFORMULA(if(isblank(A2:A),"",IFERROR(if(REGEXMATCH(A2:A, "ABC|PQR|XYZ"),"Yes","No"),"Not Found")))
Its giving correct result but is case sensitive, how to make this formula case insensitive. Below is the link of the sheet: https://docs.google.com/spreadsheets/d/164kxDO9aWZzr5qXjvtRlk_tiRoKU1W7Xc-Ig9VH8qzE/edit#gid=1474753063
Regards

You can use some case conversion function. Try-
=ARRAYFORMULA(if(isblank(A2:A),"",IFERROR(if(REGEXMATCH(UPPER(A2:A), "ABC|PQR|XYZ"),"Yes","No"),"Not Found")))

Related

How to extract the exact match from the string by using REGEXEXTRACT in Google Sheet

I have one issue with REGEXEXTRACT in Google Sheet. I want to match and extract the exact word. If I use the below formula, it will display the result “Sing,” but I want it to display “NA.” Because the source cell i.e A1 cell does not have the “Sing” word but it has the word "Singapore".
=regexextract(A1,”(?i)Sing”)
So, how can we extract the exact match instead of the partial match?
Thanks & Regards,
Vineet
REGEXEXTRACT is going to extract the part of the string that matches your regex expression. What you need to use is REGEXMATCH which returns a TRUE or FALSE and use it as a condition for IF:
=IF(REGEXMATCH(A1,(?i)Sing”), A1,"")
use:
=IF(REGEXMATCH(A1; "\b(?i)sing\b"); A1; "NA")
(?i) case insensitive
\b boundary

Scalable Regexmatch formular

i need help with the following formula:
IF(REGEXMATCH(LOWER(B3), JOIN("|",Keywords!H$2:H$13)),"unqualified","qualified")
B3 is in this Case the String "I need help". My problem is that id like to use the Formula
IF(REGEXMATCH(LOWER(B3), JOIN("|",Keywords!H$2:H)),"unqualified","qualified")
so i dont always need to match the Row with the Keywords. Otherwise i have Spaces in the join formular and the results are always "unqualified".
Does anyone has an idea how i can rewrite this formula into a more "scalable Version"?
I hope everything i explained was understandable.
Try this out. You can remove the LOWER and make the regex case insensitive
=ARRAYFORMULA(
IF(ISBLANK(B3:B),,
IF(
REGEXMATCH(
B3:B,
"(?i)"&TEXTJOIN("|",TRUE,Keywords!H2:H13)),
"unqualified",
"qualified")))
I solved my problem with this formula:
IF(REGEXMATCH(LOWER(B3), JOIN("|",QUERY(G$2:G,"select G Where G is not null"))),"unqualified","qualified")

If & match function together in spreadsheets

I wrote this formula in the spreadsheet: =if(match(AR$2,$A5:$E5,0),AR$2,"")
If there is no match, it's supposed to leave the cell blank, instead it gives #N/A. but if there is a match, it gives the value. Can anybody show me how to correct this? thanks.
You could use iferror
try something like:
=iferror(if(match(AR$2,$A5:$E5,0),AR$2),"")

Google sheet arrayformula join() and split() functions

Does anybody know how to arrayformula this join function?
My formula is not as complex as the example here. ArrayFormula a Filter in a Join (Google Spreadsheets)
It does not contain a filter function, so I'm not sure what from that answer applies and doesn't apply.
I want to array formula this: =if(isblank(B2),,join("," ,B2:I2))
Using the normal way to array something doesn't work:
=ArrayFormula(if(isblank(B2:b),,join(",",B2:b:I2:i)))
Also for splits, I have split(B2, ",")
=ArrayFormula(split(B2:B,",")) does nothing but the first row
Maybe try:
=ArrayFormula(if(len(B2:B), B2:B&C2:C&D2:D&E2:E&F2:F&G2:G&H2:H&I2:I,))
or
=ArrayFormula(substitute(transpose(query(transpose(B2:I),,rows(B2:B)))," ",""))
or, in case you want a space between the concatenated values:
=ArrayFormula(trim(transpose(query(transpose(B2:I),,rows(B2:B)))))
For using split() in arrayformula a workaround can be found here

Google Drive Spreadsheets: Combining IF and VLOOKUP

I'm trying to work out a formula for combining an IF statement and a VLOOPUP.
Basically, I want the formula to return a value if a value was found through VLOOKUP, or to return something else if not found...
I have experimented with
=IF(VLOOKUP(A1,$B$2:$B$31, 1, 0),"FOUND","NOT FOUND!")
... but this doesn't seem to work.
Many thanks for any thoughts you might have...
An old thread but would like to submit a cleaner solution for the Vlookup example or places where you want to use the value returned by a formula-
=IFERROR(VLOOKUP(A1,$B$2:$B$31, 1, 0),"NOT FOUND")
If you just want to check whether A1 exists in B2:B31 then VLOOKUP isn't required. Either use MATCH like this
=IF(ISNUMBER(MATCH(A1,$B$2:$B$31,0)),"FOUND","NOT FOUND")
or shorter with COUNTIF
=IF(COUNTIF($B$2:$B$31,A1),"FOUND","NOT FOUND")
ISERROR() can test to see if a formula generates an error or not.
In this case, IF and VLOOKUP can be combined using
=IF(ISERROR(VLOOKUP(A1,$B$2:$B$31, 1, 0)),"NOT FOUND!", "FOUND")
=IF(ISNUMBER(MATCH(
C2,IMPORTRANGE("URL","Sheet1!B2:B2000"),0)),"FOUND","NOT FOUND")
If the matching data is in another file we can use the above formula.

Resources