Split Function with Index Match function - google-sheets

I have a column that has multiple comma separated values, I need to use Split function and then run index match on that column, is it possible ? if yes somebody can help pls

Yes, you can do this, I just tested it in google sheets.
=INDEX(<array>,MATCH(SPLIT(<cell>,","),<array>,0))
To be honest, I was googling for something similar and ran across this issue. My problem turned out to be that I was using ',' and NOT ",". I suspect you asked this question for similar reasons (you tried it and it didn't work). So just to confirm, it is totally possible, the issue is likely an error with your formula.
output of a minimal example, using the above formula, matching on the first split:

Related

Extracting Wanted Data from the Raw Cell

I have been trying to extract the required data from a single cell and I have tried using some common formulas but its not working for all the cells exactly.
I would appreciate your help in this regards.
Google Sheet
Formula 1
=LEFT(A2,FIND(C2,A2)-1)
Formula 2
=SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(LEFT(RIGHT(A2,len(A2)-FIND(") ",A2)),6),")",""),"(","")),"|","")
I duplicated your tab and entered the following formula in cell E2:
=ArrayFormula(ifna(regexextract(A2:A,"\[\s\]\s(.+)?\s\((.+)\)")))
Explanation
\[\s\]\s - find [ ]
(.+)?\s\( - extract everything after it until the next occurence of (
(.+)\) - extract everything after the above ( and before the next occurence of )
EDIT: The first time I've tried #ztiaa answer it didn't work... don't know why. I kept investigating REGEX and gave it another try, and it did... You'd probably prefer that. I leave my answer just as a memory, and if it's useful for someone else in another scenario
Honestly, I don't handle regex as #ztiaa, but what I've found difficult about your example is that there are sometimes more than one opening parenthesis... that's why I looked for a way of finding the last appearance of "(". You can learn more about this workaround here
I changed "#" with "CUT HERE" in my example, just in case "#" may appear in your example. With that in mind, you can set these two formulas:
=ArrayFormula(IF(A3:A="","",MID(A3:A,5,FIND("CUT HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))-5)))
=arrayformula(if(A3:A="","",mid(A3:A,FIND("CUT HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))+1,FIND(")",A3:A,FIND("CUT
HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))+1)-FIND("CUT
HERE",SUBSTITUTE(A3:A,"(","CUT
HERE",LEN(A3:A)-LEN(SUBSTITUTE(A3:A,"(",""))))-1)))
The second one is really long because it has to find the amount of characters in between brackets. But it appears to work. Probably there's a more ellegant way with Regex, I repeat :)
Look in J and K of your example:

=LEN Function in Google Sheet not working corretly

I have a column with lots of rows containing text. I want to highlight cells with over an x-amount of characters, but how? The code I'm using in combination with 'Conditional Formatting' is not working all the time. Sometimes it highlights text over the x amount and sometimes it doesn't, so there is something I'm doing wrong here. The x-amount in the example below is: 300.
you may also need to lock it like:
=LEN(E$1:E$170)>300
Silly me... I found the answer myself. I need to put in the same range in the formula as well. Formula with the range E1:E170 needs to be: =LEN(E1:E170)>300

Replace 0's with FALSE and 1's with TRUE

I'm using a COUNTIF formula to find matches between two ranges. Of course, COUNTIF returns a numerical value, but I need TRUE or FALSE values. So I added NOT() to the formula, which gave me TRUE/FALSE, but in my case, the results were backward, so I added an additional NOT() to reverse the results and this works fine for my purposes.
My question is: is there a better way to do this? Obviously, this isn't a lot of characters to type (I've put more effort into typing this question...), but if there is a simpler, cleaner solution, I'd like to know.
Here is my full formula:
=NOT(NOT(COUNTIF(projectSelections!B2:B&projectSelections!C2:C,itemsAssociations!A3:A&itemsAssociations!B3:B)))
=ARRAYFORMULA(A1:A10=B1:B10)
=ARRAYFORMULA(REGEXMATCH(A1:A10, "^"&B1:B10&"$"))
=ARRAYFORMULA(IF(A1:A10=B1:B10, TRUE))
=ARRAYFORMULA(NE(A1:A10, B1:B10))
=ARRAYFORMULA(REGEXMATCH(""&A1:A10, "^"&B1:B10&"$"))
I don't know specifically about google sheets, but in general a double negation is not an unusual technique to convert a numeric value to a boolean.
Alternatively, there is also the possibility to check if the value is not equal to zero, which in the case of google sheets can apparently be done with the NE() function: NE(COUNTIF(...) ,0). As explained in the documentation, NE(a,b) is equivalent to a <> b.
You're overthinking. To get TRUE and FALSE just use
=COUNTIF(...)=0
Nothing wrong with what you did. Another option is to use Perl or Python to clean up the data file. You could export in CSV format or clean up before going into google docs.

Countif function not counting word with an apostrophe

I’ve looked through the forum, but haven’t found a solution. I’ve got some survey responses in a table like so:
It’s okay
I don't like school
It’s okay
Good, I like it
I’m using a countif function to count the number of times each response was received in the survey. The thing is my function works well with these values:
I don’t like school
Good, I like it
but my function does not pick up the phrase
It’s okay
As I’m using named ranges, the formula I am using is:
=COUNTIF(Question,"It's okay")
Please see this shared link for the example file and check out sheet 2 for the actual formula.
https://drive.google.com/open?id=1e1ccJh3TDeOsIrcn0f5ewQ3M6xOuBrfKBqqJ3mzXfV0
Initially, I thought the issue was that the countif function wasn’t working because of the apostrophe in the word “it’s okay”. As you can see from my example, there are other words with apostrophes in them that get counted so I’m baffled as to why this function is not working for the phrase “it’s okay”.
Has anyone seen this problem before, or any ideas as to how I could accomplish the same thing using another process?
I’ve also tried to escape the apostrophe like so :
=COUNTIF(Question,"It''s okay")
=COUNTIF(Question,"It\'s okay")
But neither case made any difference.
Many thanks in advance
That's because you have different apostrophes in data and in formula:
’ ("Right single quotation mark", ASCII code 146) in data
' ("Single quote", ASCII code 39) in formula

Filter and logical operators

EZ stuff but after an hour.. =filter(May15!A:S , May15!E:E="Authorization") is yielding a rich populated sheet. However I can't get OR working! Despite it working elsewhere in the sheet. I'd like other possibilities via the same filter. I tried several including the OR this way
=filter(May15!A:S , OR(May15!E:E="Authorization" , May15!E:E="bigwhale", May15!E:E="hi"))
.. to no avail. Any help appreciated. Also, I read somewhere the OR could be accessed using a "+" and that sounded like a neat method.. Thanks!
One possible way is to use RegEx:
=filter(H:H , REGEXMATCH(E:E,JOIN("|",A1:A3)))
put in A1:A3:
Authorization
bigwhale
hi
This trick is useful when you need to add conditions, just paste one more value in cell A4 and use range A1:A4
Another way is to use plus sign:
=FILTER(H:H,(E:E="Authorization")+(E:E="bigwhale")+(E:E="hi"))

Resources