Comparing two dates in excel gives wrong result - excel-2010

I'm doing a date comparison using the IF function and I get wrong results. Here's a screen:
First two columns have dates in them. They are formatted as 'Date' format. The formula is:
=IF(U19<V19;TRUE;FALSE)
First row gives a wrong result while the second is ok. I double checked and there are no extra spaces in the cell.

Related

Google Sheets – Query for a date returns no values

​​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")&"'")

How do I conditionally format a date that falls between two dates from a list of start and end dates?

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

Value imported can't be changed to a number

I'm using the function importhtml() on my Google Sheets :
=IMPORTHTML("https://fbref.com/fr/comps/13/Statistiques-Ligue-1";"table";3)
The data are imported but some data are displayed "01.08" and the value is a date. The other values are ok if they contains big number like 1.93. How it's possible to change that and have only numbers and not displayed that value as a date ?
I try to change the format of the cell but the value became a number like 44455.
This is a screen of what I have
Just with the importHTML without any cell formatting
After I format the cell as brut text
How can I have the value as a number so to display 1.08 and not 01.08 ( for Google SHeets this is a date )
Thanks a lot in advance
Just add a fourth parameter, which stands for locale.
=IMPORTHTML("https://fbref.com/fr/comps/13/Statistiques-Ligue-1";"table";3;"en_US")
This solved the problem here, since it turns the decimal points into commas, not allowing GS to interpret it as date format.

Compare dates in WHERE request within QUERY in GoogleSheets

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.

I get Formula parse error with all formulas

I want to use basic functions in google spredsheets (which works just fine in excel) but I get
"Formula parse error"
on all of them.
For example, there is table where date is in one column, and according value in second. I want to extract, into another sheet, value from the 1st week to the first row, value from the week +1 to second etc....
=OFFSET(A2, 1, 0)
=OFFSET(A2, 1, 0, 1, 1)
I get Parse formula error. It is happenning also with other formulas, LEFT, CONCATENATE etc... Is there anything wrong in the way I write them?
This might be a locale issue. Some locales use a comma as argument separators, others (e.g. some European countries) use semi-colons (;).
So maybe try changing your comma's into semi-colons?

Resources