Import data from another sheet using ID but only some columns - arrays

I have a google sheet like this :
And another one like this :
I want in the second google sheet to pull data from the first sheet that matches those IDs
I have tried index & match, vlookup, lookup but none of them got me to my point especially with using importrange to pull data from the second file I couldn't solve my
Thanks in advance for your help
This is where I am trying to make the magic happen if you are wondering :
https://docs.google.com/spreadsheets/d/1TZYo641Av4SHaHLjSPuAZv3DSnVw0pqSubbtsiYw8Uk/

use:
=ARRAYFORMULA(IFNA(VLOOKUP(A2:A, {Mother!B:B, Mother!A:A, Mother!C:D}, {2,3,4}, 0)))

Related

Google Sheets: Using Transpose on an array in other tabs & identifying the tab by

I would appreciate some help, please.
I have a google sheet with many tabs with data going horizontally.
I would like to create a formula that imports and transposes the data into a vertical list.
However, I want to be able to type in (or drop-down list) to select the tab which the transpose formula to look at. I cannot get anything to work. I have tried this
=TRANSPOSE(A1&!B2:J2)
To add to that if it could use a lookup (vlookup or hlookup) to find the correct row to transpose then that would be great also.
I have set up a test sheet below. Please help. Many Thanks Tim https://docs.google.com/spreadsheets/d/1Menn6Z1mLl8wYOrcdQFnfs7Lp0dbC9UJe1S3AQRcOS0/edit#gid=0
You should not use IMPORTRANGE to work with data that exists anywhere in the same spreadsheet. IMPORTRANGE is for use retrieving data from a separate spreadsheet.
Instead, delete your current Sheet1!A2 formula and replace it with this:
=ArrayFormula(TRANSPOSE(INDIRECT(A1&"!B16:J16")))
I also added a new sheet ("Erik Help") with an advanced formula that accomplishes your lookup using whatever is types in B1. If whatever is typed in B1 exists in Column A of the selected sheet, the results of that row will be retrieved. If no match is found, IFERROR will return "No Match Found."
That formula, in 'Erik Help'!A2:
=ArrayFormula(IFERROR(QUERY(TRANSPOSE(INDIRECT(A1&"!B"&VLOOKUP("*"&B1&"*",{INDIRECT(A1&"!A:A"),ROW(INDIRECT(A1&"!A:A"))},2,FALSE)&":"&VLOOKUP("*"&B1&"*",{INDIRECT(A1&"!A:A"),ROW(INDIRECT(A1&"!A:A"))},2,FALSE))),"Select * WHERE Col1 Is Not Null"),"No Match Found"))

How do I get value of an indirect formula into a format that can go into an array?

My Google Sheet that will be updated over time with new sheets. On my dashboard/master sheet, I can write a simple INDIRECT that will pull information from a cell in the sheets. However, the formula does not replicate its way down the column. I understand that I need to use an ARRAYFORMULA to get the auto formula placement done.
I've tried many ways but the one that I think may get me there is to use CONCAT. My columns look like this:
Event Title [uses a script to pull in the names of all the sheets]
Use an array to get the titles so they pre-poluate down the column so I can use it later: =ARRAYFORMULA(IF(Row(A:A)=1,"Get Title from A",IF(ISBLANK(A:A),"",A:A)))
-- The Event Title is now appearing as plain text in Column B.
I then use CONCAT to write the part of the formula I need to help get the name of the INDIRECT in without using the INDIRECT formula.
=CONCAT("'"&B5&"'"&CHAR(38)&"!"&"""","B2"&"""")
-- This gets me this result: 'Computers 101'&"B2"
At this point, my hope is that I could then use this information ('Computers 101'&"B2") into an ARRAYFORMULA. I used this formula to try and do that:
={"Event Date";ARRAYFORMULA(A6:A+D6:D&"Cat")}
-- I get the answer: 0
The expected value was the date cell (B2) in the Computers 101 sheet. Any ideas how to proceed? I don't know the names of the sheets in advance.
unfortunately, this is not possible within of scope of google sheets formula. if you need ranges from other than the actual sheet you need to use INDIRECT which is not supported under ARRAYFORMULA.
you have 3 options:
hardcode it like: https://stackoverflow.com/a/68446758/5632629 with IFERROR & array of empty cells to match columns of your range
generate formula which will generate your final formula/range as a text string and then use a simple script to convert that string into the valid formula: https://stackoverflow.com/a/61819704/5632629
do it all with scripts

Google Sheet Query Formula

Is there any way that without importing the data in helping sheet we can use vlookup as I have created in Sheet1 to lookup the values from other sheet “Directly” by using IMPORITNG (Query formula?
Here is current formula.
=ArrayFormula({"Comments";IF(A2:A="","",IFERROR(VLOOKUP(TRIM(A2:A)&B2:B&"|"&C2:C&D2:D,{TRIM('Sheet1 Import'!A2:A)&'Sheet1 Import'!B2:B&"|"&'Sheet1 Import'!C2:C&'Sheet1 Import'!D2:D,'Sheet1 Import'!E2:E},2,FALSE),"*** NOT FOUND ***"))})
But above formula is taking the data from helping sheet I am trying to create a formula that directly match the result and take relevant data from another sheet.
I have created this formula but its not working ?
=INDEX(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!E:E"),MATCH(1,(A2,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!A2:A")(B2,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!B2:B")(C2,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!C2:C"),0)))))
Sheet links
https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0
https://docs.google.com/spreadsheets/d/1_9Vumt1a-1WnrXAHOpJd1GUTQ3jLjPifwGyKlDDRyi0/edit?usp=sharing
From the question
Is there any way that without importing the data in helping sheet we can use vlookup as I have created in Sheet1 to lookup the values from other sheet “Directly” by using IMPORITNG (Query formula?
One way is to add the VLOOKUP formula on the source spreadsheet then import the result. Another way is to use Google Apps Script.

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))))

Resources