this topic has been discussed in some formats, but not specifically this one. I have used an array formula in Google Sheets that works, but does not work when exported to Excel. Can you help me modify the formula so that it works in Excel?
=ArrayFormula(index('Technical Lookup Tables'!J14:L17, MATCH(C39&C40,'Technical Lookup Tables'!H14:H17&'Technical Lookup Tables'!I14:I17,0)))
This is what the reference table looks like:
And this is the output:
This formula can be written in Excel as a non-array formula:
=index('Technical Lookup Tables'!J14:L17, MATCH(C39&C40,index('Technical Lookup Tables'!H14:H17&'Technical Lookup Tables'!I14:I17,0),0))
Related
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"))
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
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.
I am trying to use the contents of a cell from a different worksheet as part of the wildcard criteria within my SUMIF function elsewhere. Here is what I have that is returning the correct value:
=SUMIF('PASTE SAP DATA HERE'!H:H,'PASTE SAP DATA HERE'!L:L,D23&"*")
I would like to use the same value within D23 but from a separate worksheet where it should be stored:
=SUMIF('PASTE SAP DATA HERE'!H:H,'PASTE SAP DATA HERE'!L:L,'March SAP Core Data'!A18&"*")
The second attempt currently returns the value 0. Any help would be greatly appreciated!
"Look at the data, make sure there are no spaces or other non visible characters that might be throwing off the matches. If the matches are numbers or dates, make sure that both are true numbers or dates and not text that look like numbers or dates. The formula looks like it should work. – Scott Craner"
-From comments
I'm attempting to automatically populate a Google Sheets column in a "Results" sheet with the following formula, which draws data from a "Source" spreadsheet:
=IFERROR(INDEX(Source!$B$2:$D,MATCH($A2&C$1,Source!$B$2:$B&Source!$C$2:$C,0),3)," ")
When I place that formula in ARRAYFORMULA, it does not auto-populate, and changing the MATCH search_key to a range (i.e., $A2:$A&C$1) does not fix the problem.
I.e., neither of these work:
=ArrayFormula(IFERROR(INDEX(Source!$B$2:$D,MATCH($A2&C$1,Source!$B$2:$B&Source!$C$2:$C,0),3)," "))
=ArrayFormula(IFERROR(INDEX(Source!$B$2:$D,MATCH($A2:$A&C$1,Source!$B$2:$B&Source!$C$2:$C,0),3)," "))
Is there a way to fix this? Or an alternative way to automatically fill a formula? I'm also open to using a function other than INDEX/MATCH, so long as it can do a lookup based on two vertical criteria. Unfortunately I don't think a pivot table would suit my purposes, since my "Results" page also queries another spreadsheet to provide other information.
Example here: https://docs.google.com/spreadsheets/d/1dsaMYsJeZl2o_rNTLwaVhnEehFvAKRMXghAJeEK220s/edit?usp=sharing
This is the formula you are looking for:
=ARRAYFORMULA(IFERROR(HLOOKUP(Source!$D$2,Source!$D$2:$D$11,MATCH($A2:$A4&C$1,ARRAYFORMULA(Source!$B$2:$B&Source!$C$2:$C),0),0),0))
I tested this and it works perfectly fine.
TL;DR
To answer why your formula is wrong,
The second argument in MATCH should have an ARRAYFORMULA otherwise you are basically matching only with first element.
INDEX doesn't work with ARRAYFORMULA. It can only search for a single value in a given range.
The first part can be solved by adding ARRAYFORMULA inside MATCH.
A simple VLOOKUPcould have solved the second problem if you weren't searching for a combination of cells (Date and Name). A twisted HLOOKUP comes to your rescue.
Without the IFERROR part, the formula looks like this:
=ARRAYFORMULA(HLOOKUP(Source!$D$2,Source!$D$2:$D$11,MATCH($A2:$A4&C$1,ARRAYFORMULA(Source!$B$2:$B&Source!$C$2:$C),0),0))
This formula produces the same output (see cell I1):
=QUERY({Source!A:D,ARRAYFORMULA(VLOOKUP(Source!B:B,'Project Lookup'!A:B,2,0))},"select Col2,Col5,sum(Col4) where Col1 is not null group by Col2,Col5 pivot Col3")