Google Sheets DGET() does not find values - google-sheets

I have a fairly simple table, which looks like the following:
I want to get a specific value from that table. For that I am using two different formulas:
=iferror(DGET(Bazaar!$A:$K;"Top Sell-Offer";{"Item";"ENCHANTED_COAL"});"?") ==> returns "?"; Should get some numbers
=iferror(DGET(Bazaar!$A:$K;"Top Sell-Offer";{"Item";"ENCHANTED_OBSIDIAN"});"?") ==> returns "2747" as expected
I also tried =index(filter(Bazaar!$B:$K;Bazaar!$A:$A="ENCHANTED_COAL");;1)
which does return what I expected, but I can't specify the column I want by header.
Note that both strings for conditions and column headers are copy-pasted and thus character-perfect (As you can also see in the results.)
Also note that this does not happen with the truncated table provided, please refer to this sheet.
Why do I get such inconsistent results and what can I do about that?
Thanks in advance! Stay healthy!

I made a copy of your sheet and messed around with it. Finally, I decided to remove the IFERROR part and I got the error of "More than one match found in DGET evaluation.". The error was the key.
The formula is seeing "ENCHANTED_COAL_BLOCK" as another match for "ENCHANTED_COAL". Once I removed "COAL" from coal block, the formula worked as it should.
In order to get it to stop seeing double (to find an exact match), simply add an equal sign in front of the word you are looking for:
=IFERROR(DGET(Bazaar!$A:$K,"Top Sell-Offer",{"Item";"=ENCHANTED_COAL"}),"?")
=IFERROR(DGET(Bazaar!$A:$K,C$3,{$A$3;"="&$A5}),"?")
I recommend adding the equal sign in front of all words you search for just for consistency purposes.
Reference: https://infoinspired.com/google-docs/spreadsheet/exact-match-in-database-functions-in-google-sheets/

Related

Trying to index match information from 1 google sheet to another

I have the following 2 google sheets
TEST 1
https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit?usp=sharing
TEST 2
https://docs.google.com/spreadsheets/d/15PAI8nnTzp1wQuvvkHxZ81kkeRrqHrvUH1vXiF9tya0/edit?usp=sharing
In Test 2 in cells B36,B37 and C36,C37 I am trying to grab information from TEST 1 to TEST 2
I have checked and checked and triple checked but I am not sure why it is not grabbing the information over.
Previously I had used "-" and "( )" in the table names so I decided to remove all of those and use only letters but it is still not working.
I also noticed that it was grabbing from the correct column (in my original google sheet), column D but it was grabbing the wrong information.
But I checked the name I was using to match "Room BS Harvest" and made sure it matched in both google sheets but still was not able to get it to work.
I have turned on show formula so you can see that I have formulas in Test 2 B36,B37,C36,C37
If you have any idea why it is not working please do let me know. I can't figure out why it is not getting the data over.
I myself would not approach things the way you are doing in this sheet. (I always recommend using a separate sheet within your destination spreadsheet where IMPORTRANGE brings in all of the data from the source location, and then using that single sheet in the destination spreadsheet as the reference for all other formulas, such as the ones you're trying to use.)
In addition, your sheets are inaccessible (i.e., "Comment only"). So neither I nor anyone else would be able to setup an alternative method for you to consider.
That said, and working with what you do have, here is how you might adjust the B36 formula...
Here is the formula you originally wrote (and which is not working):
=INDEX(importrange("https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit#gid=0",$J$1&"!A4:H26"),MATCH($A36,index(importrange("https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit#gid=0",$J$1&"!A4:A26"))),match($J$2,index(importrange("https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit#gid=0",$J$1&"!A4:H4"))))
Here is my edit to that formula structure (which should work):
=INDEX(IMPORTRANGE("1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg",$J$1&"!A4:H26"),MATCH($A36,IMPORTRANGE("1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg",$J$1&"!A4:A26"),0),MATCH($J$2,index(IMPORTRANGE("1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg",$J$1&"!A4:H4")),0))
Notice that you only need the spreadsheets ID number for IMPORTRANGE, not the entire URL. This just makes reading such formulas easier.
You also had mismatched sets of parentheses. This was your biggest issue.
And I recommend using the third parameter of MATCH to indicate what kind of match you're looking for. (Here, I assigned 0, which means "exact match only.")
Hopefully, you can use that as a model for editing your other formulas.

Index / Match - Receiving an error when trying to find entry

I am very fresh with Excel and still learning the basics. I came upon an issue I really need help with and couldn't find suitable solution online.
I have a column I keep on constantly updating with Bulk data THE COLUMN.
I'd like to see the most common entry and the least common entry for a specific time using this formula:
=INDEX('Data Input'!F433:F610,MODE(MATCH('Data Input'!F433:F610,'Data Input'!F433:F610,0)))
But once I try it, it constantly tells me:
Did not find value '' in MATCH evaluation.
I've tried with shorter ranges and It did work, so I guess once it runs through empty cell - it breaks. How can I modify this formula to function properly and print what I need?
And side question, is is possible to implement a calendar bar and choose between dates?
You can insert a clause to exclude blanks (assuming they are not to be considered a legitimate return):
=INDEX('Data Input'!F433:F610,MODE(IF('Data Input'!F433:F610<>"",MATCH('Data Input'!F433:F610,'Data Input'!F433:F610,{0,0}))))
Note that I have used
{0,0}
for MATCH's match_type parameter so that the formula will not error should there be more than one entry within your range which shares the highest frequency. In such cases, the above formula will return that which occurs first in your list.

OR Operator in Google Sheets Not Working?

This is the formula I am working on right now:
=FILTER(Data!A:K, SEARCH("Gretsch", Data!F:F)+SEARCH("Krutz", Data!F:F))
I'm trying to bring in both rows that include "Gretsch" and rows that include "Krutz". Just using one of those instead of both works just fine, and using keywords that the other has included in it's results (for example, searching just Gretsch brings up 10 or so (out of the 100+) products that include "Streamliner" in the F Column, as well as Gretsch, so using this formula:
=FILTER(Data!A:K, SEARCH("Gretsch", Data!F:F)+SEARCH("Streamliner", Data!F:F))
brings up the 10 or so products with both, but I'm looking for one OR the other, so why is that '+' acting like an AND operator instead? Am I just completely off base?
SEARCH returns a number: the starting position where a string is found within another string. It's not a simple 1 like other tests for TRUE, and there is no 0 case (i.e., FALSE) as you have it written. In addition, if either SEARCH does not find the target string, it returns an error; and a number plus an error... returns an error (which is not TRUE and therefore will not be included in the FILTER).
A better approach to achieving OR with FILTER:
=FILTER(Data!A:K, REGEXMATCH(LOWER(Data!F:F),"gretsch|krutz"))
The pipe symbol ("|") means OR in this context, and you may list as many pipe-separated strings as you like. Notice that the search range is wrapped in LOWER and that the terms to search are also lowercase; this assures the same kind of caps-agnostic search you were looking for with SEARCH.
By the way, based on your other recent post, you can also use REGEXMATCH with NOT, e.g.:
=FILTER(Data!A:K, REGEXMATCH(LOWER(Data!F:F),"gretsch|krutz"), NOT(REGEXMATCH(LOWER(Data!F:F),"case")))
One additional note: Your post is tagged "Excel" and "Google Sheets." The formulas I've proposed will only work with Google Sheets. In most cases by far, it is best to tag a post here with either "Excel" or "Google Sheets" but not both, since the differences are substantial between the two.
try:
=QUERY(Data!A:K, "where lower(F) contains 'gretsch'
or lower(F) contains 'krutz'")

How do you refer to all cells above the cell inside a match function?

Here's what I'm trying to do: I have a list of courses in Google sheets to which items will be added daily by pasting them at the end of the current list. I then want to check if a course has already been added to the list before. If that is the case, the value of a certain column will get the value that the first occurrence of that course has. So I will be using =INDEX(MATCH... and the range in the match part will be all the cells in the column above the cell that is checked. The MATCH part of the formula is obvious if you drag or copy the formula downwards:
= MATCH(A2; A$1:A2; 0)
However I was experimenting with other ways of achieving this, namely
MATCH(A2; "A$1:A"&ROW()-1; 0)
(I also tried this one without the quotation marks) and
MATCH(A2; (ADDRESS(1;1;2)&":"&ADDRESS(ROW()-1;1; 4)); 0)
Both of these don't work. I can't figure out why. (BTW, the semicolon is ok where I live). I get #N/A everywhere and the message that the value has not been found in the match evaluation.
Any thoughts on what I am doing wrong? Also: if I would get this to work, are there any advantages or disadvantages over copying the simple formula all the way downwards? Thank you very much in advance.
Here's an ArrayFormula approach so you only need a single formula
=ArrayFormula(IFNA(IF(MATCH(A2:A,A2:A,0)<>ROW(A2:A)-ROW()+1,A2:A,"N/A")))
It is because second parameter of MATCH function requires range, but you in both cases pass the string. I don't know why you don't like the first option, but you may be able to use the OFFSET function.
=INDEX(A:A;MATCH(A2; OFFSET($A$1;0;0;ROW()-1); 0))

Google Sheets COUNT/FILTER function

I'm having some trouble getting these functions to work. I'm not even sure if they're the ones that I should be using, but here is the following information I can provide. I had previously opened a topic, but I was getting responses about my confusing query. So, hopefully this one is better explained.
I have data in the following fields: A1:N7, as well as A12:L18.
I need a function to check all of the fields and add up the amount of times certain numbers show up. The numbers that need to be checked are: <90, 90-99.99, 100-109.99, and =>100.
First off, I can use this formula to count the <90 and =>100 values in all the fields, which works.
=COUNTIFS(A1:N7,"<90")
However, I'm unsure how to appropriately add the results from A12:L18 into it. My attempts have failed. Likewise, for the ranged functions, I'm completely lost. I've tried something like this:
=COUNT(FILTER(A1:N7,A1:N7>=90,A1:N7<=99.99))
Yet, this always returns 0 as the result. In addition, like the above formula I don't know how I'd nest in a way to check the additional fields in A12:L18.
An old thread, but I came across it trying to solve a similar problem.
Using the original example:
=COUNT(FILTER(A1:N7,A1:N7>=90,A1:N7<=99.99))
I was also getting zero until I realised COUNT returns the number of NUMERIC values in the range. Assuming the result range isn't numeric, I tried:
=COUNTA(FILTER(A1:N7,A1:N7>=90,A1:N7<=99.99))
and got the result I was expecting.
You just need count rows your matrix with ROWS()
=ROWS(FILTER(...))
Does this formula work as you want:
={"<90",COUNTIF({A1:N7;A12:N18},"<90");"90-99.99",COUNTIFS({A1:N7;A12:N18},">=90",{A1:N7;A12:N18},"<100");"100-109.99",COUNTIFS({A1:N7;A12:N18},">=100",{A1:N7;A12:N18},"<110");"=>110",COUNTIF({A1:N7;A12:N18},">=110")}
I made an example sheet where you can see it working: https://docs.google.com/spreadsheets/d/1BPexh5syksapZ9rd_brAa3NkN28LXAvB6dVMLEkM2r0/edit#gid=0

Resources