Extract the difference between two Strings - join

I'm looking to extract the difference between two cells containing strings in Google sheets.
I've tried to use the search, split and regexextract formulas with no luck.
Cell A1;
- "IE, DE, FR, GB, IT"
Cell B1;
- "IE, FR, GB"
Cell C1; (The aim is to have cell C look as follows)
- "DE, IT"**
Any suggestions or solutions would be greatly appreciated!

Try in cell C1
=join(", " ,filter(split(A1,", "), (isna(match(split(A1,", "), split(B1, ", "),0)))))
and see if that works?

try:
=JOIN(", ", FILTER(SPLIT(A1, ", "),
NOT(COUNTIF(SPLIT(B1, ", "),
SPLIT(A1, ", ")))))

Related

Table to 9^9 query header to table again

I have this sheet with a table
I want to go from the table to nested header and back to table again from the nested ranges header.
I tried using split transpose to expand the table, but it didn't work.
looking at your dataset it is not possible to go from A12 to A16. you will need to attach some unique symbols first and only then you can cut it with split fx
in A12 use:
=ARRAYFORMULA(QUERY(SUBSTITUTE(TRIM(A1:E9), " ", "♦"),,9^9))
in A16 use:
=ARRAYFORMULA(SUBSTITUTE(TRANSPOSE(SPLIT(FLATTEN(A12:E12), " ")), "♦", " "))
or full:
=ARRAYFORMULA(SUBSTITUTE(TRANSPOSE(SPLIT(FLATTEN(QUERY(SUBSTITUTE(
TRIM(A1:E9), " ", "♦"),,9^9)), " ")), "♦", " "))

Google Sheets Formula to refine data of a column

Is there any formula to extract a website from a cell value in google sheets
convert value from 1st column to as shown in 2nd column
You can use regex to retrieve string with pattern like website:
=REGEXEXTRACT(G1,"[a-zA-z]+\.[a-zA-z]+\.?[a-zA-z]+")
Reference:
REGEXEXTRACT
try:
=INDEX(TRIM(FLATTEN(QUERY(TRANSPOSE(
IFERROR(IF(ISURL(SPLIT(A1:A, " ")), SPLIT(A1:A, " "), ))),,9^9))))

Please give me an ArrayFormula for this formula

I want to achieve column I.
Formula is:
=textjoin(char(10),false,A4:F4)
When I convert to Arrayfromula:
=transpose(split(textjoin(char(10),false,{ArrayFormula("~"&A4:A),A4:F}),"~"))
Editable Sheet link
In my Arrayformula the first value is repeating, Please Help!
EDIT:
Is there any way to achieve Arrayformula 1 (two columns) & Arrayformula 2 (single column)?
Numbers sheet:
(Basically not include cells with value 0)
The formula should even work with Strings as data not compulsorily Numbers as shown below:
Strings & Numbers sheet:
(Basically not include cells with value 0 & NULL)
try:
=ARRAYFORMULA(REGEXREPLACE(REGEXREPLACE(FLATTEN(QUERY(TRANSPOSE(
TO_TEXT(A4:F6)&"×"),,9^9)), "×", CHAR(10)), " ", ))
update:
=ARRAYFORMULA({IF(TRIM(FLATTEN(QUERY(TRANSPOSE(A4:F),,
9^9)))="",,JOIN(CHAR(10), A1:F1)),
REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(FLATTEN(QUERY(TRANSPOSE(
TO_TEXT(SUBSTITUTE(A4:F, " ", "♀"))&"×"),,
9^9)), "×", CHAR(10)), " |\n$", ), "♀", " ")})
=ARRAYFORMULA(IF(TRIM(FLATTEN(QUERY(TRANSPOSE(A4:F),,9^9)))="",,
REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(FLATTEN(QUERY(TRANSPOSE(
TO_TEXT(SUBSTITUTE(IF(A4:F="",,A1:F1&": "&A4:F), " ", "♀"))&"×"),,
9^9)), "×", CHAR(10)), " |\n$", ), "♀", " ")))

Equally divide a list of names in Google Sheets

We are using Google Sheets to track a list of about 60 people. We add and remove some each week. I am using functions like this to join them into a groups, =TEXTJOIN(", ", TRUE,$A$2:$A$15)
I would like to replace the $A$2:$A$15 part with something that would take 1/5th of the total list regardless of how long or short it becomes. Is this possible?
If you want to group only the first fifth:
=TEXTJOIN(", ", TRUE,$A$2:INDEX($A$2:$A,ROUNDUP(COUNTA(A2:A)/5)))
or if you want group all:
=TEXTJOIN(", ", TRUE,FILTER($A:$A,ROW($A:$A)>=(ROUNDUP(COUNTA($A:$A)/5)*(ROW()-2)+2),ROW($A:$A)<=(ROUNDUP(COUNTA($A:$A)/5)*(ROW()-1)+1)))
try:
=TEXTJOIN(", ", 1, INDIRECT("A2:A"&ROW(A2)-1+ROUNDDOWN(COUNTA(A2:A)/5)))
or:
=TEXTJOIN(", ", 1,
QUERY(A2:A, "where A is not null limit "&ROUNDDOWN(COUNTA(
QUERY(A2:A, "where A is not null", 0))/5), 0))

Delimiting a column using "OR" in Google Sheets

I am using google sheets and would like to combine the text in cells of a column to a single cell separated by "OR" (with spaces on either side of the OR"
For example
**Column A**
John
Bob
Jim
Donald
would be combined in a single cell as "John OR Bob OR Jim OR Donald"
What formula in Google Sheets would I use to accomplish this?
try:
=JOIN(" OR ", A1:A4)
or:
=TEXTJOIN(" OR ", 1, A:A)
if you hit the limit try:
=ARRAYFORMULA(A1&" "&QUERY(IF(A2:A<>"", "OR "&A2:A, ),,999^99))
See if this works
=textjoin(" OR ", 1, A2:A)
Change range to suit.

Resources