Why does vlookup not work with dates in Google Sheets - google-sheets

I have to find a value by date in Google Sheets between multiple tabs. I boiled it down and boiled it down until I made the most simple example I could find, and yet it still didn't work. Date notations are the same, the dates are a match, but still it reads like a number and returns an n/a. Made an example sheet, feel free to mess around
Example sheet

Or this
=index(C:C;MATCH(A6;D:D;0))

try like this:
=IFNA(VLOOKUP(A1; {D:D\ C:C}; 2; 0))

Related

Google Sheet SUMIF returning an error! statement

pretty new to google sheets, my question could seems awkward but i'm struggling with a sumif in google sheets.
I'm using a sumif to sum up some values with a simple condition and i struggle to find the right way to do it. Assuming the documentation i do it well but i must be missing something because the result is always : ERROR!
See the example below
The example is simple, applying exactly what the documentation says but still not working.
I tried to make the cell format number for the condition, still not working.
I tried to make the condition a string by typing "=1", still not work. I tried to use a cell value in the condition B5 for example, still not working.. I'm desperate, i don't understand why this simple example is still not working.
If someone could help it will save my time.
Chances are that your spreadsheet is using a locale that expects formula arguments to be separated with semicolons instead of commas, like this:
=sumif(B5:B10; 1; C5:C10)
You can set the locale in File > Settings > Locale.

how can I write a formula that uses a cell's contents when building a range reference to the name of another sheet?

I have a large Google Sheets spreadsheet that has individual sheets for financial statements of activity for multiple years. I want to reference particular columns of those in other sheets, and I've successfully figured out how to do that with an HLOOKUP function. However, because I want to do this for multiple years, I'd like that HLOOKUP function to pick up the name of the sheet to reference from its column header. Right now, I'm hard-coding it like this—you can see the HLOOKUP range refers to cells in the "2021 Overall" sheet. The hard-coded approach works but makes adding a new year tedious. Ideally, the HLOOKUP formula would read the contents of its column header cell to determine which year it is.
As best I can tell, the solution is to use INDIRECT, but I can't figure out any way to build the formulate with INDIRECT and not get an error. For instance, this seemed like it should work. As you can see, I have 2021 in cell D4, and my INDIRECT statement is referencing that and building the rest of the range.
I've also tried using INDIRECT with an explicit CONCATENATE, with no more success.
Any ideas for how to look up that D4 cell and slide it into the HLOOKUP range?
Thank you!
Try to remove the "'"& before D4 and the ' after the Overall.
Your formula should look like this:
=IFERROR(HLOOKUP($A$2,INDIRECT(F4 &" Overall!$A$5:$X$150", Utility!$A10, FALSE)))
With Nikko's nudges in the right direction, I eventually figured out the right format. This allows the formula to work in multiple sheets and to be filled right (for more years) and down (for more classes).
=IFERROR(HLOOKUP($A$2,INDIRECT("'"D$4&" Overall'!$A$5:$X$150"), Utility!$A3, FALSE))
Note that if you try to replicate this, you may need to type the formula out from scratch—I had a problem where pasting it in didn't work. Once I'd retyped it and Google Sheets acknowledged it, it worked from then on in the spreadsheet, even when pasted from sheet to sheet.

How to show duplicates on 2 google sheets at the same time?

This conditional format command shows duplictes on the Sheet1 perfectly:
Appliy to range A:A
=COUNTIF(A:A,A1)>1
Is it possible make it work with Sheet2 at the same time. I've read that INDIRECT could help but I don't understand how to do that.
I tried this with no luck:
If you want it to check both sheets for duplicates, you can still use almost the same formula, but you have to put the references into an Indirect statement:
=countif(INDIRECT("Sheet1!A:A"),A1)+countif(INDIRECT("Sheet2!A:A"),A1)>1
as mentioned in the documentation

Google Sheets: CountIf and Dates

Haven't gotten any help through the Google Product Forums, so I'll try here. I've never had issues with this before so not sure what I'm missing now. I can't seem to make a rather simple formula work and I have no idea why.
For some reason, =COUNTIF(SCHEDULE!$C$9:$C29,">="&B$2) returns 0, when I'm expecting it to return 21.
In B2 is the date "6/25/2018", which is actually a reference to
SCHEDULE!C2.
Am I just not understanding the logic correctly? "If the dates in C9:C29 are after or equal to 6/25/2018, then count them."
When I try it as <= it doesn't work either.
I don't think there is an issue with the dates being formatted using TEXT(B2,"MM/DD/YYYY") because other formulas seem to be working fine.
Alternatively, I also tried using SUM(QUERY), but that also got hung up when using the dates.
=sum(query(SCHEDULE!A9:AB,"select count(F) where F='2004' and C >= date '"&TEXT(DATEVALUE(B2),"yyyy-mm-dd")&"'",0))
You can see a test version of the sheet HERE.
I am working from the REF sheet.
You can see what I've tried in Z6, Z7, Z8 and AA6.
Any suggestions would be appreciated. I feel like I'm missing something obvious. I'm not sure if it's the fact that some of the dates from the SCHEDULE page are rendered using TEXT, but I can't figure this out.
Ref!B2 is TEXT(SCHEDULE!$C$2,"MM/DD/YYYY"). You cannot compare text-that-looks-like-a-date to true dates.
The best option is to use =SCHEDULE!$C$2 in REF!B2 and format the cell as mm/dd/yyyy.
The bandaid (dig a hole then fill it up) is to adjust your COUNTIF to,
=COUNTIF(SCHEDULE!$C$9:$C29,">="&DateValue(B$2))

SUMIF with FIND as criteria

I'm trying to summarize data from several Google spreadsheet' sheets in a single one but I have some issues with SUMIF and FIND.
To Sum data from another sheet I have to use this (at least that's the only solution I've found)
=SUM(INDIRECT(""&A6&""&"!E2:E"))
Where I have the name of my sheet on A6.This makes everything easy because I have a column (A) with all the names of the sheets. I haven't found something like Sheets[1] in Google Docs.
My next step was to Sum Times from a specific column but remove a specific values, which in this case is 1 that get transformed internally 24:00:00 since it's a time column:
=SUM(INDIRECT(""&A6&""&"!D2:D")) - SUMIF(INDIRECT(""&A6&""&"!D2:D");"24:00:00")
Here I tried to do everything with a single SUMIF but I have no idea how. NOT("24:00:00") didn't work so I settled to this.
The last part is the most difficult and I'm not able to solve it.
I have a column with month names (for example) and I want to sum some data only when the month name contains "er". Here is what I thought:
=SUMIF(A6:A16,ISNUMBER(Find("er")),G6:G16)
This gives me always 0
(Note that the last one contains A6:A16 instead of the whole INDIRECT part because I am still testing it in a single sheet.)
Any Idea what I'm doing wrong?
I don't know why the above SUMIF doesn't work, what I've tested and works is:
=SUMIF(A6:A16,"*er*",G6:G16)
SUMIF is NOT SUM + IF as I thought. I hope it will help someone else.

Resources