Concatenate two VLOOKUP arrays - google-sheets

I have two columns as arrays:
Column (A) = ArrayFormula(ifna(VLOOKUP(F2:F,Auditors!A:B,2,0)))
Column (B) = ArrayFormula(ifna(VLOOKUP(G2:G,Supervisor!A:B,2,0)))
The only way is to concatenate them and copy paste to the end of column, but I need help to concatenate them as a new array separated by ,:
A,B

Do you need concatenation like this?
=ArrayFormula(ifna(VLOOKUP(F2:F,Auditors!A:B,2,0) & ", " & VLOOKUP(G2:G,Supervisor!A:B,2,0)))

Related

how to concat/merge two columns with different length?

I'm new to google sheet. I have a column(E) with the date and another with a session(F), I want to merge them into one column with each date & different session just like the first few rows in column C.
I've tried "=ArrayFormula(concat(D2:D,concat(" ",F2:F5)))" in column C but only got the first date.
use:
=INDEX(QUERY(FLATTEN(FILTER(E2:E, E2:E<>"")&" "&
TRANSPOSE(FILTER(F2:F, F2:F<>""))), "where not Col1 starts with ' '", ))
see: https://stackoverflow.com/a/68775825/5632629
In your cell C1, try this formula:
=ArrayFormula(E1:E&" "&F1:F)
Well you can simply do concatenate cells like this:
CONCATENATE(E1, " ", F1)
to get what you want I think.
What you're looking for is a cartesian product. I don't have a single formula that does the entire thing for you, but I can suggest a two-step approach.
Get the cartesian product with this formula:
=ARRAYFORMULA(SPLIT(FLATTEN(E2:E9 & "|" & TRANSPOSE(F2:F5)), "|"))
This gives a pair of each date against each time in two result columns. You can then concatenate each row of them in a final result column.

Is it possible to limit COUNTIF to certain columns?

When I apply COUNTIF to a range that contains calculations, I get an error message.
To avoid that, can I also narrow the range only to certain columns?
For example, instead of =COUNTIF($A$1:E;F1) something like =COUNTIF($A$1:A AND $C$1:C AND $E$1:E;F1)
So that certain columns like B and D in my example are not included in the range?
You can join the columns with {} and separating columns with "," like this:
=countif({A1:A;C1:C;E1:E},F1)
Try using COUNTIFS instead of COUNTIF with range and criteria as key-value pairs.
=COUNTIFS(A1:A, "=" & F1, C1:C, "=" & F1, E1:E, "=" & F1)
Make sure to replace commas with semicolons for the formula to work in your locale.

Join character to columnar array

I want to add a character ("~ ") to the front of each value of a columnar array, but every formula I've tried concatenates the values into a single cell rather than back to the column array. Do I need to add SPLIT? What am I doing wrong?
This is what I've tried most recently
=JOIN("~ ",FILTER(Categories!A2:A,LEN(Categories!A2:A)))
=ArrayFormula(TEXTJOIN("~ ",TRUE,Categories!A2:A))
=ArrayFormula(JOIN("~ ",{Categories!A2:A}))
Ultimately, what I would like to see in a single column is:
~ Category 1
~ Category 2
etc.
=ARRAYFORMULA(IFERROR(SPLIT(IF(Categories!A2:A<>"", "~ ♦"&Categories!A2:A, ), "♦")))
=ARRAYFORMULA(IF(Categories!A2:A<>"", "~ "&Categories!A2:A, ))

Extract unique values from a table in Google Sheet

I'm working on Google Sheet spreadsheets and I'm looking to get in a column the unique values of the table I show.
Suppose the table has the following values
A-B-C
B-C
A-D
With the Split function I can separate the values.
=SPLIT(B12;"-")
A B C
B C
A D
I'm stuck on the final point, which is to get the unique values.
A
B
C
D
In a single formula (sorted, no blanks):
=sort(unique(transpose(split(textjoin("-",1,A:A),"-"))))
Assuming your data is in columns A:C, =UNIQUE({A1:A3;B1:B3;C1:C3}).
You can also unbind the ranges. =UNIQUE({A:A;B:B;C:C}).
The curly braces {} combine the ranges.
The semi colons ; tell the curly braces to combine the ranges vertically into a single column for the UNIQUE function to parse.

Google sheets - How to concat multiple values into multiple links

I am working with a google sheet that in one column can hold 1+ strings of numbers, and in another column, needs to read those numbers in and concat them with a link.
What I mean by this is and what works thus far: Column A - 324243324 || Column B - =concat("google.com/", Column A) = google.com/324243324
What I hope to get working: Column A - 324243324 5004938 || Column B - =concat("google.com/", Column A) = google.com/324243324 google.com/5004938
Is this possible? Thank you for your help!
You want to (a) split the input by spaces; (b) prepend each part by "google.com/"; and (c) join again, separated by spaces. This is achieved by
=join(" ", arrayformula("google.com/" & split(A1, " ")))
The & operator is equivalent to CONCAT but easier to type. arrayformula indicates that the operation is done on an array (the output of split).
However, these links will not be hyperlinked; joining makes them into plain text. To keep them functional, remove the last step, "join", so that each link appears in its own cell.

Resources