Google Query on the results from unique function - google-sheets

I am using google sheets and applied a UNIQUE function on a set of columns and want to apply a query function to take couple of columns and all rows from the the results to a different sheet, but I am getting blanks.
Can you please suggest what am I doing wrong?
Does the Query function not work on the results from UNIQUE function?

Open or create a sheet.
Select a cell.
Type = followed by the sheet name, an exclamation point (!), and the cell being copied.
For example, =Sheet1!A1 or ='Sheet number two'!B4.
Note: If a sheet name contains spaces or other non-alphanumeric symbols, include single quotes around it (as in the second example).

Related

Google Sheets LOOKUP Function returning the wrong values?

I'm creating a crypto tracking spreadsheet and I'm getting some strange results using the LOOKUP function.
I have two named ranges:
The symbol range is called USDCoinSymbols
and the coin name range is called USDCoinNames
Here are some function results when I try using the LOOKUP function:
Apologies for the mixed casing on the search term. I was experimenting, but
it seems the LOOKUP function isn't case sensitive (for example, BNB returned the correct coin name).
I also tried the inverse, looking up a coin symbol with a coin name (2nd result) and that works fine.
I spent a good couple hours trying to figure this out.
Am I missing something or is this a bug?
Edit: Here is a link to sample spreadsheet and I'm using the CoinGecko API to get this data.
I'm trying to pull the coin name using the symbol to fill up a table I'm creating.
This is not a bug. It's just how LOOKUP works.
LOOKUP requires that all search-column information be in strict least-to-greatest order, so it wouldn't work with your data.
I've added a new sheet ("Erik Help") which is a duplicate of your first sheet. In my sheet, I deleted your LOOKUP formulas from B20:B27 and replaced them with one array formula. This formula uses VLOOKUP with FALSE as the final parameter, meaning that your data is NOT ordered in strict least-to-greatest order and that exact matches should be searched anywhere instead. This one formula fills all results for B20:B:
=ArrayFormula(IF(A20:A="",,IFERROR(VLOOKUP(A20:A,B2:C14,2,FALSE))))
If you are going to be applying this to a larger list elsewhere and want to use your named ranges, just replace B2:C14 with {USDCoinSymbols, USDCoinNames}.
References:
LOOKUP
VLOOKUP
You will need to use the VLOOKUP function instead
=INDEX(IFERROR(VLOOKUP(A20:A25, {USDCoinSymbols, USDCoinNames},2,0)))
This single formula is all you need.
Since your lists are NOT sorted you should use 0 in the function
(please -as always- adjust formula according to your ranges and locale)

In google sheets extracting words from column based on reference column

In this scenario, I have a reference column (A) of 6 types of devices, and a second column (B) of several thousand specific device names including the word from the reference column in the string.
I am trying to extract into a new column (C), from the column B just the relevant word from the string that corresponds to the reference column.
So far have been unsuccessful in finding the right working formula.
You can use VLOOKUP function to search particular data and get desired result.

I need to compare values between two sheets to find matching items

I need to compare two different sheets to find matching values between them.
In the first sheet, I have a list of order numbers and in the second one, I have a list that needs dispatching. Therefore, without scrolling through the sheet manually for the 1000+, I'd like to use a formula or conditional formatting in order to flag the values that are the same (or all of the different values) so I can simply copy and paste this into another sheet.
I have shared a link to a google sheet below if someone could help with this that would be very much appreciated.
Edit: The second sheet (on the google document) is the list of all orders and the first are the ones to be dispatched. I need to know which one's from the second sheet are missing from the first.
https://docs.google.com/spreadsheets/d/18vSBu9GzxK1UMCE2RrDyNSH6yi-FzTvuABsVw9r172Y/edit?usp=sharing
In second sheet in column B you could do:
=COUNTIF(Sheet1!A:A,A2)
IF the formula returns 0, it means that id number is not in your first sheet.

Reference a Cell as the Name of a Sheet in Another Workbook

I have ~400 sheets spread through multiple workbooks (on purpose). Each sheet is the scoring for an entry in an award competition.
I have a master scorecard sheet that grabs the score from each sheet, regardless of what workbook it is in. I have been able to set up the formula so, if I hardcode the name of the sheet in some other workbook, it correctly grabs the data:
=(IMPORTRANGE("LINKtoWORKBOOK","SHEETNAME!CELL"))
But this requires identifying SHEETNAME in every instance of this formula. I would rather create a single column that lists the names of each sheet, and then for a given row, have that row's formulas all look to the cell with the sheet name.
I've tried using INDIRECT but had no luck. I think I am close:
=(IMPORTRANGE("LINKtoWORKBOOK",(INDIRECT(CELLwithSHEETname&"!CELLonTHATsheet"))))
I've tried variations of quotes and moving parenthesis with no luck.
The second argument of IMPORTRANGE should be text value (string) so you can concatenate the sheet name to the cell / range reference. I.E. if A1 has the sheet name use
=IMPORTRANGE("spreadsheet_key",A1&"!A1:Z")
NOTES:
INDIRECT function can't be used because it returns a reference as if it is directly written in the formula, i.e.
=A1
is the same as
=INDIRECT("A1")
but IMPORTRANGE requires that the second argument be a text value, so the above will only work when A1 has something like A1:Z or Sheet1!A1:Z (without the equal or plus sign)
Arrays can't be used as arguments of IMPORTRANGE. In other words, something like
=ARRAYFORMULA(IMPORTRANGE("spreadsheet_key",A1:A10))
doesn't work. In this case the alternative is to use multiple IMPORTRANGE, one for each reference.
Related
Using IMPORTRANGE, INDIRECT, and CONCATENATE together
Using IMPORTRANGE as an array formula
ArrayFormula + multiple IMPORTRANGE + QUERY

reference cell via two partial matches on another cell

I need to match two conditions on the cell Name and add the price information into cell price if both condition match. In other words, if Name contains both conditions, get the price. I tried different approaches using QUERY, SEARCH; FIND; VLOOKUP but I got stuck somewhere in the middle. Here's the example sheet (Google Spreadsheet solution preferred over Excel):
https://docs.google.com/spreadsheets/d/1zwG3_5Ctg_IZ1kI04Uee-qIvMrNQ4GmEwySmYcMKLfA/edit?usp=sharing
Maybe important: Both, the Name values as well as the whole reference table get pulled from other files dynamically. So I don't know anything concerning order or length of these columns in advance, not even if there are matches at all.
In addition to previous answer AND given the current set of data (in a Google spreadsheet), in B2 try:
=ArrayFormula(iferror(vlookup(regexreplace(A2:A; "[^A-Z]"; ""); {E2:E&F2:F\G2:G}; 2; 0)))
and see if that works ?
Based on your spreadsheet table:
you can try the following formula:
this formula works in excel not in google spreadsheets
=IFNA(INDEX($G$2:$G$6;MATCH(1;COUNTIFS(A2;"*"&$E$2:$E$100&"*";A2;"*"&$F$2:$F$100&"*");0));"NOT FOUND")
this is an array formula, so press ctrl+shift+enter to calculate the formula.
i think it will do the job.
here is the example file to download

Resources