I'm trying to query a range that returns only rows where the date in Column S is older than the date in Column D
All dates in the sheet are already formatted yyyy-mm-dd but I can't seem to find any suggestions on how to use WHERE with a range of dates, rather than either a single date or a specific cell.
=QUERY(Sheet1!A2:W11536,"select A,B,C,D,E,F,G,H,I,J,K where date '"&text(Sheet1!D2:D,"yyyy-mm-dd")&"' > date'"&text(Sheet1!S2:S,"yyyy-mm-dd")&"'")
This is giving me an N/A error: "Query completed with an empty output."
When I make it < rather than > it populates without error, though it's not showing the desired results. There should be valid data for >.
Thanks!
I think this is enough when you're comparing two columns
=query(A:H,"select A,B,C,D,E,F,G,H where C>H")
(although I couldn't find any rows that satisfied the criteria in your test sheet)
I think what is actually happening is that it is just comparing the first two dates so you either get all of the data or nothing.
Related
I'm trying to filter a list from another sheet by the dates of the entries and simply doesn't work:
=QUERY(Import!A:Z;"select A,T where T >= date '2021-08-27'";0)
When I remove the date part it works fine, as expexted for filtering by text. I need the ability to sort by exact dates though, because I would like to add some more complex filters. When I set the last part of the function to a 0 instead of a 1 it shows only the first entry.
The source column is set to the correct date format. The data is pulled from another document using the IMPORTRANGE() function (I don't seee how this should make any difference though).
I feel like I'm misssing something simple here and would be glad if someone can point me in the right direction!
Check your date column if all cells are formatted as date. I had missing values as "='---" and the query filtering by date returned nothing. Changing the missing values to "=NA()" did the job.
Try this:
=QUERY(Import!A:Z;"select A,T where T >= date '"&TEXT("2021-08-27";"yyyy-mm-dd")&"'")
I have created a dynamic calendar in a Google Sheets document and with it a list of dates:
The days are dynamically populated with the full date but formatted to only show the day (for example, the full value of August 22nd is 8/22/2020 but it is formatted to only show 22). I would like to use conditional formatting to highlight the date ranges listed on the right. For instance, I would simply like the dates 8/12, 8/13, and 8/14 (in addition to the other date ranges in those columns) to be highlighted using conditional formatting.
I've been able to get single ranges highlighted by directly targeting the I and J cells in the range A3:G8 like so:
=AND(A3>=$I$2,A3<=$J$2) or by switching up the column value. Removing any $ symbol breaks the conditional formatting.
I know this is not correct to get each range in the list to appear, but this is the only way I could get any ranges to work. Obviously I don't want to go one by one, but nothing else I've tried has worked. I've spent the last 5 hours scouring the internet and have come up with nothing like this problem. I have tried too many things to list here, and nothing has worked.
FWIW, this is my test data set. My full data set is much larger, is not sorted by start date, and has some start dates missing. I could potentially clean up the missing start dates if necessary, but my final dataset can't be sorted.
Ideally, the final product should look something like this:
Try
=SUMPRODUCT((A1<=$J$2:$J)*(A1>=$I$2:$I)*(A1<>""))>0
You can add as many rows as you wish.
Explanation
In this formula, you have 3 conditions
=SUMPRODUCT(condition1 * condition2 * condition3)
If one condition is false, you will get 0 (for instance truefalsetrue = 0 )
If all three conditions are true, you will get something > 0, that means that the date is not null and between a range of dates
in Google Spreadsheets I have a column A with dates and column B with specific values corresponding these dates:
A
B
10-Jan
51.1
11-Jan
49.2
14-Jan
50.3
If I find via VLOOKUP function the value of 11-Jan, it will work and show 49.2.
Off cause it won't work if I try to find a value of 13-Jan since it is absent from the list of dates. However, if the date is absent in column A I want to get the value of earlier date which is in the list (i.e. I want to get 49.2 corresponding to 11-Jan, if I use 13-Jan as the query for finding the value).
Maybe this type of search can be realized by using INDIRECT function, but I can't figure out the formula.
How do realize this?
Your problem can be solved by using vlookup only but with different parameter, if you indicate True for the last parameter, it mean the formula will try to return the closer match if it cannot found any result.
=arrayformula(VLOOKUP(E1:E5,A:B,2,True))
I'm trying to query a bunch of dates and it generally works fine, except for the first result. This does not get recognized as a date.
I query the date with =query(A1:B50;"SELECT A";1) where dates are in column A.
Subsequently I use the output to create events in Google calendar, except the first result of the query doesn't get recognized as a date.
Anything I can do about that?
Thanks!
If cell A1 contains a date and not a column heading, try:
=query(A1:B50;"SELECT A";0)
However, It's not clear why you're using QUERY and {A1:A} may work just fine instead.
I am using Google Sheets to give me the total number of candidates being recruited from different sites in a date range. I am getting a formula parse error from:
=COUNTIFS('Candidates being recruited'!$G$2:$G$1000,$A4,'Candidates being recruited'!$K$2:$K$1000">11/1/2015",'Candidates being recruited'!$K$2:$K$1000"<11/7/2015")
Candidates being recruited is the tab I am pulling from.
$G$2:$G$1000 is the site listings
$A4 is the specific site name
$K$2:$K$1000" is the date column
then I am listing the date range I am looking for.
What am I not seeing?
You didn't put a comma between the second and third range and condition as it needs the two and can't take an array of TRUE/FALSE values.
This formula approach with Candidates being recruited'!$K$2:$K$1000">11/1/2015" would be possible with array formulas but unnecessarily verbose.
Try
=COUNTIFS('Candidates being recruited'!$G$2:$G$1000,$A4,
'Candidates being recruited'!$K$2:$K$1000,">11/1/2015",
'Candidates being recruited'!$K$2:$K$1000,"<11/7/2015")