Google sheets: How do I return a text value based on a column matching an entire range? - google-sheets

I need help returning a text value "WIP" based on column A matching an entire range.
The range has digits which users will input that match column A but cells will have more than 1 digit which will be seperated by a comma.
I'm not clear on how to do this so i'm stuck somewhere with:
Sumproduct, isnumber, and match yet i'm struggling how to yield a result.
Could you please help?
Thanks a lot!
Spreadsheet link: https://docs.google.com/spreadsheets/d/1XcIql3ZMymqipZsGUyBk3_ze6LMzjQtHTF-ylGDIT_A/edit#gid=0
Output highlighted in yellow

You can try:
=ArrayFormula(IF(Isnumber(MATCH(A9:A38,FLATTEN(SPLIT(FLATTEN(IF(LEN(G8:M18),G8:M18,)),",")),0)),"WIP",))

Related

Search defined row for a string, return value 2 columns to the right of located string

I'm using google sheets, and trying to look up the string value in cell A2, check row 2 of Sheet2 for matching string, then (once found) return the value in the cell 2 columns to the right of the found string.
=INDEX(Sheet2!$A$2:$2,MATCH($A2,Sheet2!$A$2:$2,2))
I thought this would work, but it unfortunately does not. Nor do my other attempts.
I've tried a variety of googled suggestions, but most seem to show a vertical column being searched rather than a horizontal row, and/or return a value in a known/fixed column, rather than a relative one.
Sheet here with example, feel free to edit;
https://docs.google.com/spreadsheets/d/1ZtgrCepZivt7AHH6ShC3SQOXWKUqmzl5qickPE9O93c/edit?usp=sharing
Any help here would be much appreciated!
Edit:
Suggestion worked great. What if I were to return the value 2 columns to the right, and 2 rows below the matched value?
What about this?. Puting a 1 to indicate that's in the same row and adding 2 to the value of MATCH:
=INDEX(Sheet2!$A$2:$2,1,MATCH($A2,Sheet2!$A$2:$2,0)+2)

Google sheet Query formula that use text from one column to match another column returning text from adjacent cell

I have a dropdown text column, Claims!B2:B that is supposed to match Ref!A2:A and select Ref!B2:B text.
I tried
=ArrayFormula(IF($B$2:$B="","", LOOKUP($B$2:$B,Ref!$A$2:$A,Ref!$B$2:$B)))
some results not consistent
=QUERY(Ref!A2:B,"Select B where A = "&B2:B&"")
resulting in error
=FILTER(Ref!B2:B,Ref!$A$2:$A=B2:B)
wrong results and not arrayed.
I like to know what should be the simplest array formula for the scenario and if possible correct my other trials for my learning process.
Sample data attached. sample supplier
Please use
for your Category column
=INDEX(IFNA(VLOOKUP(B2:B,Ref!A2:C,3,0)))
and for your GST Stats
=INDEX(IFNA(VLOOKUP(B2:B,Ref!A2:C,2,0)))
(As you notice the only difference is the column number from 2 to 3)
Functions used:
INDEX
IFNA
VLOOKUP

Perform a search on range of dates and text fields and return a match for the first column

I have been trying a few solutions but I am pretty stuck. I am trying to find out if a date is included in a named range and return the period name of the corresponding row ( ie value in first column)
I have tried, using match, vlookup, hlookup- but none of them seem to match the value. I have even made sure that both are formatted as date.
Any help would be welcome!
https://docs.google.com/spreadsheets/d/1T3sdrkciyXkOgD23S-5rFvvDbK-bHFlh7yv4LwkpHiQ/edit?usp=sharing
C3:
=ARRAYFORMULA(TEXTJOIN(,1,IF(A3=G$7:AY$19,F$7:F$19,)))
IF to get Column1
TEXTJOIN to remove blanks

In Google Sheets, how can I find text within a range of cells?

I have a range of cells in one column, some contain text and some are blank cells. I want to search the range for the first occurrence of a word. I know that it's possible to combine Index and Match functions to find exact text within a range of cells. But I need to search for partial matches. I've tried mixing using the Search function, but it doesn't seem to accept a range. How can I search a range for the first partial text match? I only want to use formulas, not script.
The search function can be applied to a range using arrayformula wrapper:
=arrayformula(search("str", C2:F9))
This returns a bunch of #value! errors where no match is found, or the position of substring when it's found. A more readable output is produced with
=arrayformula(if(iserror(search("str", C2:F9)), , C2:F9))
This leaves non-matches blank, and returns the actual cell content where there is a match. Or you could put row(C2:F9) at the end to get the row numbers, etc.
We can simply use vlookup or match formula to find a string from a specific range
Vlookup example:
=VLOOKUP(B2, $B$2:$B, 1, FALSE)
Match example:
=MATCH("Sunday",A2:A9,0)
=MATCH(DATE(2012,1,1),A2:F2)

Google Sheets right() in Sum in Arrayformula returning false values

I've a column of sample data where each cell is either blank or (3 alpha chars, 1 white space, 1 digit). For example:
I need to check if the cell begins with "GTR" or "DBT", then return the number, and sum the return of the column. I'm using the formula below:
=ARRAYFORMULA(sum(IF(OR(left(A1:A10,3)="GTR",left(A1:A10,3)="DBT"),VALUE(right(A1:A10,1)),0)))
The problem is that instead of returning 20, it returns 52.
In fact it appears to return the last char of any cell in the range. (eg. if "A5" has a value of 'someText' the formula returns an error because value() can't parse 't' into a number.
I'd like to know if anyone can tell me how to solve this problem, or if there's something wrong with my formula?
Here's an example of this problem in a Google Sheet:
https://docs.google.com/spreadsheets/d/1XNVUWhI43UW2ABrja8rmplmxhhkSu-je45F-9F_3GQM/edit#gid=0
Thanks,
Onji
The ArrayFormula plus OR will evaluate to TRUE if any of the cells in the range is in the codition, to overcome this remove the OR, and add an IF for every condition, as such:
=ARRAYFORMULA(sum(IF(left(A1:A10;3)="GTR";VALUE(right(A1:A10;1));0);IF(left(A1:A10;3)="DBT";VALUE(right(A1:A10;1));0)))
In addition to the solution of Kriggs, this formula should also work:
=ArrayFormula(sum(if(regexmatch(B3:B12, "GTR|DBT")=TRUE, right(B3:B12)+0,)))

Resources