Check cell for multiple strings and return specific values - google-sheets

I'm trying to create a Google Sheet formula that searches for a word in a longer string and returns a specific value based on the string being searched.
I can achieve this in Excel but I need this to work in Google Sheets.
Below is an example of what I'm trying to achieve:
The "Sort" column is retrieving the value based on checking if the word in column "C" exists in column "A".
I've tried using wildcard search but this isn't working for me in Google Sheets, and other examples I've seen online don't seem to allow me to return multiple values.
Any help would be much appreciated.

This formula may fit you:
=IFERROR(REGEXEXTRACT(A1,JOIN("|",FILTER(C:C,C:C<>""))),"none")
Here're some useful links:
REGEXEXTRACT
JOIN
FILTER

Related

IMPORTRANGE with Blacklist on Google SHeets

I'm quite novice so I apologize if this is obvious. I'm trying to have an import range show names and another value from another google sheet, but exclude those from a blacklist. I have pasted the formula I'm currently working with below. Any ideas?
=QUERY(IMPORTRANGE("XXXXX", "XXXX!$A:$B"), " skipping != 'Blacklist'!$A:$A")
The import range it pulls from is a Filter already, I've pasted that below. Could it be worked there?
=IFERROR(FILTER('XXXXX'!$A:$B, 'XXXXXX'!$H:$H = "ABCD")," ")
Thanks in advance!
FILTER is my preferred way of removing from a list.
Here is the formula
=FILTER(A2:A6,NOT(COUNTIF(B2:B3,A2:A6)))
You can think of it like
=FILTER( list ,NOT(COUNTIF( needle , haystack)))
Usually you use this to whitelist a document (hence why I dedicated this formula to memory in a needle-haystack fashion.) But by throwing in the NOT in the criteria of the filter, it works great for blacklisting too!
As to why it works, I'm not sure, my best guess is when google sheets is running through the COUNTIF for any given cell if it meets the criteria it will return a '1' which is truthy and it includes it in the results. This also allows us to compare un-even amounts of data. ie. B2:B3 rather than B2:B6

Fill rows when a value is not in a column in google sheets

I need to create a list from a column when the cell doesn't contain a given text.
In the example above I want to exclude the folders that have the words (Archive, Rollback, rollback) as below.
I know
=countif(B2:B20,"<>*Archive*")
gives us the count but doesn't allow me to define more than one search phrase and also doesn't give a list.
Is it possible to use an Array Formula? where =ARRAYFORMULA(B2:B20) can be changed to exclude the words in B22
Test Sheet is in https://docs.google.com/spreadsheets/d/1WnGEsuuJcKsHVhpyYCX5EpmIxuKQEst5XVXgeETzxJ4/edit?pli=1#gid=1789577026
See the 'List_Excluding_Words' worksheet and feel free to add a worksheet with possible solutions.
Would a regex method work in this case like? Google Sheet REGEXMATCH function case insensitive
I understand this can be done using filters but I want a full list so I can run other processes on it and it doesn't allow for more than one phrase.
In B26 on the tab 'JPV_HELP' I entered
=filter(B2:B20, not(regexmatch(B2:B20, "(?i)Archive|Rollback")))
See if that works for you?

Why this query on google sheets return error?

I've read tons of topics and tons of links about writing this query but keeps returning #ERROR!. I have no clue what's wrong, the query line I wrote is:
=QUERY(B2:B180;"SELECT "col3" WHERE "col2" CONTAINS "E2"";-1)
What's wrong?
If you want to know more about the problem:
I have a google form created to take a lists of objects that my team has, I want to put in a cell the keyword I'm searching and want excel to return me the name of all the people who owns that object, in normal excel I would write a vba probably but in google sheets I find it a way harder.
P.S. I tried to write the col3 in other ways but seems he doesn't understand , while E2 lights on the google sheets and seems it understood what it is.
The range is only one column (B2:B180) so there simply is no Col3. Also in this query, you should refer to columns by letter: "select B, C, ...".

Count the number of occurrences of a value on a multi-page spreadsheet

The spreadsheet has many pages and more pages will be added in the future and I don't know the names of these future added. I can't just do:
=countif(Tab1!A:Z,Value1)+countif(Tab2!A:Z,Value1)+countif(Tab3!A:Z,Value1)...
because I don't know the names of these tabs to be added.
Is there a way to count the occurrences on new sheets without explicitly adding them in such a formula?
It seems that this can not be achieved using a formula. It must be written as a script. You can see an example at this question: COUNTIF Statements: Range Across All Sheets + Cell Reference as Criterion
I'm not sure if what you're trying to do is possible. But, I can help you with the getting the spreadsheet pages/sheets name part.
By using this sheets projection:
https://spreadsheets.google.com/feeds/worksheets/{spreadsheetId}/public/basic
you'll be able to get the list of all spreadsheet pages in xml format.

reference cell via two partial matches on another cell

I need to match two conditions on the cell Name and add the price information into cell price if both condition match. In other words, if Name contains both conditions, get the price. I tried different approaches using QUERY, SEARCH; FIND; VLOOKUP but I got stuck somewhere in the middle. Here's the example sheet (Google Spreadsheet solution preferred over Excel):
https://docs.google.com/spreadsheets/d/1zwG3_5Ctg_IZ1kI04Uee-qIvMrNQ4GmEwySmYcMKLfA/edit?usp=sharing
Maybe important: Both, the Name values as well as the whole reference table get pulled from other files dynamically. So I don't know anything concerning order or length of these columns in advance, not even if there are matches at all.
In addition to previous answer AND given the current set of data (in a Google spreadsheet), in B2 try:
=ArrayFormula(iferror(vlookup(regexreplace(A2:A; "[^A-Z]"; ""); {E2:E&F2:F\G2:G}; 2; 0)))
and see if that works ?
Based on your spreadsheet table:
you can try the following formula:
this formula works in excel not in google spreadsheets
=IFNA(INDEX($G$2:$G$6;MATCH(1;COUNTIFS(A2;"*"&$E$2:$E$100&"*";A2;"*"&$F$2:$F$100&"*");0));"NOT FOUND")
this is an array formula, so press ctrl+shift+enter to calculate the formula.
i think it will do the job.
here is the example file to download

Resources