Google Sheets ARRAYFORMULA() different results from Excel{}? - arrays

I'm getting some odd results when using an ARRAYFORMULA() function in Google Sheets. Comparing the same formula in Excel, I get a correct answer in Excel and an incorrect answer in Google Sheets.
Here is a shared Google Sheet with the error and a screenshot of the result from Excel
The result should be 12, meaning that there are 12 months where Bob works in at least one location.
Any ideas would be much appreciated! TIA!

Google sheets has a lot of different functions. Use this instead:
=count(UNIQUE(filter(A2:A22,B2:B22=E4)))

Related

Using Google sheets arrays like in Microsoft Excel (ANDING two arrays)

Hello I would like to combine two arrays in google in such a way:
={TRUE,TRUE,FALSE}*{FALSE,TRUE,FALSE}
Where the result should equal: {FALSE,TRUE,FALSE}
In excel that formula listed above works. In google I simply get 0 as the result. What should I enter in google to get the result like I do in excel?
Example in excel I am trying to achieve Excel
Example in Google Sheets: Google Sheets
Tried:
={TRUE,TRUE,FALSE}*{FALSE,TRUE,FALSE}
Expected:
{FALSE,TRUE,FALSE}
use:
=INDEX({TRUE,TRUE,FALSE}*{FALSE,TRUE,FALSE})
and if you want a boolean back do:
=INDEX(TRUE=({TRUE,TRUE,FALSE}*{FALSE,TRUE,FALSE}))
Have you tried simply using ARRAYFORMULA? For example,
=ARRAYFORMULA({TRUE,TRUE,FALSE}*{FALSE,TRUE,FALSE})
Or, if you insist on an array of Booleans:
=ARRAYFORMULA({TRUE,TRUE,FALSE}*{FALSE,TRUE,FALSE}=1)

Choose function return 2 columns on Google Sheets

Is there any way to return the two columns in the choose function
For example, here in excel (image), I can do it with:
=CHOOSE({1\2};B1:B10;A1:A10)
formula in excel
Is there a way to do this in google sheets? Or some similar formula?
try:
={C1:C11\ A1:A11}
or if your sheet is english:
={C1:C11, A1:A11}
update:
={F1:F12, A1:E12}

Google Spreadsheet, how to grab row from other sheet using vlookup?

I got two sheets in my google spreadsheet:
MC
Items (rather big)
In "MC i got a column with different Item Names.
I need to find the matching ID from sheet "Items".
Created a vlookup for it, but cant get it to work - everything looks okay to me.
Link to sheet:
https://docs.google.com/spreadsheets/d/1Yif8Cf1g1pPI38YFCffDKQ1tE-08SWPSfRAv-TdWXTw/edit?usp=sharing
=VLOOKUP(B2,Items!$A$2:B,2,false)
What am I doing wrong here?
try:
={"id"; ARRAYFORMULA(IFNA(VLOOKUP(B2:B, {Items!B:B, Items!A:A}, 2, 0)))}

Find name in one column, return value from another

I have a spreadsheet with responses from a Google Form. They sign up for one of our trivia games, then I make a spreadsheet for each game. I wrote a FILTER function in the corresponding Google Sheet that gives me a list of all the players' names.
What I need is a function to reference the team name from the Responses sheet and give me the information in my filtered game sheet. I would like a function rather than a Javascript script to run manually. I am certain this can be done but the function methodology is escaping me.
As an example, I have created a spreadsheet in Google Sheets with some data. Can someone help me write a formula to put team names in "The Office" tab? Thanks in advance.
https://docs.google.com/spreadsheets/d/1F2bgvHXqA2wNUa98rfESWTeK22va1RMQUjnk6ma2AeA/edit?usp=sharing
In B2 try this formula
=ArrayFormula(if(len(A2:A), vlookup( match("*"&A2:A&"*", 'Form Responses'!C:C, 0), {row('Form Responses'!A:A), 'Form Responses'!B:B}, 2, 0),))
and see if that helps?
Looks like you need a VLOOKUP which grabs the value of the matching row of whatever criteria you specify. The only issue was that VLOOKUP requires the column of values being returned to be after the "lookup column" which meant moving the team names column to column D.
Here is the formula: =VLOOKUP("*"&A2&"*",'Form Responses'!C$2:D$23,2, FALSE)
I also went ahead and implemented it in your linked spreadsheet.
use in B2:
=ARRAYFORMULA(IF(A2:A="",,IFNA(VLOOKUP("*"&A2:A&"*", 'Form Responses'!C2:D, 2, 0))))

Is it possible to change countif to an array google sheets

Below are two formulas that I use to determine if courses selected are full or if there is a vacancy. I am wondering if it is possible to change these formulas to an array or if there is a workaround that would accomplish the same result.
=if(COUNTIF(G$2:G2,G2)<=(VLOOKUP(G2,$AC$2:$AD$50,2,0)),G2,"Full")
=if(W2="Full",if(COUNTIF({R$2:R;S$2:S;T$2:T;U$2:U;V$2:V;W$2:W},M2)
Edit: link to demo sheet https://docs.google.com/spreadsheets/d/1nPhrEKhKwuq3YSghgJ4LFoHZqOzo67_b1qohh1NABJo/edit?usp=sharing
I duplicated the sheet and entered in R2
=Arrayformula(IF(LEN(G2:G), if(COUNTIF(G$2:G,G2:G)<=(VLOOKUP(G2:G,$AC$2:$AD$50,2,0)),G2:G,"Full"),))
and in S2
=ArrayFormula(if(len(R2:R), if(R2:R="Full",if(COUNTIF(R$2:R,H2:H)<VLOOKUP(H2:H,$AC$2:$AD$50,2,0),H2:H,"Full"),),))
See if that works for you?

Resources