Google sheets not recognising a date as a date - google-sheets

On this report I am trying to do some date analysis.
In column G I need to pull all the URLs from column A which have a closing date in the next 7 days.
And in column I, I need all the URLs which the closing date is in the past.
The issue is that when I try to reference the Closing dates in column E it does not read and as such work.
Could I get some help on making sheets read Column E properly and also some help on the formulas I need in Column G and I
Thank you

You might want to look at the DATEVALUE function:
=DATEVALUE(D2)
If cell D2 contains a date in the form of text (such as "26 May 2022"), this formula will return the date as a number. (You can then format the cell to display a particular date format if required.)
For URLs which have ended, you can then do:
=F2 < TODAY()
And for URLs ending in the next 7 days you will need something like:
=IF(F2<TODAY(), FALSE, IF(F2 - TODAY() > 7, FALSE, TRUE))

Related

/ and - in different cells after same function

I'm trying to concatenate a column of dates and other of hours.
The fuction:
=CONCATENATE(TEXT(AGENDA!B9 ,"dd-mm-yyyy"), " ", TEXT(AGENDA!C9 ,"hh:mm:ss"))
works, but, some cells are in fuction format, dd-mm-yyyy, and some others are dd/mm/yyyy (the time is correct). I need them all with -
You have a non valid date in AGENDA sheet Fecha column note Luque, Hugo 20/08/2021 with month set to 20 !! and day is 08.
To add date validation, Select B2:B and go to Data data > validation > Criteria: date.
and select On invalid data: Show warning.
Fix the date one by one or take a look at the quick fix.
To check the date format:
Go to Formst > number > Custom date and time.
The Quick fix
To get date fixed with a formula from, mm/dd/yyyy to dd-mm-yyyy you need a helper column lets call it Fixed Date, with the formula.
=IF(ISDATE(B2)=False,CONCATENATE(INDEX(SPLIT(B2,"/-"),1,2),"-",INDEX(SPLIT(B2,"/-"),1,1),"-",INDEX(SPLIT(B2,"/-"),1,3)),B2)
Explanation
1 - IF(ISDATE(B2)=False check the date is valid if true return the original value example B2 if false calculate the formula.
2 - INDEX(SPLIT(B2,"/-"),1,2) to get the month column that resulted from SPLIT function with column set to 2.
3 - INDEX(SPLIT(B2,"/-"),1,1) to get the day column that resulted from SPLIT function with column set to 1.
4 - INDEX(SPLIT(B2,"/-"),1,3)) to get the yaer column that resulted from SPLIT function with column set to 3.
5 - CONCATENATE the columns with "-" in between.
Now you can paste your formula but adjusted in BBDD.AGENDA Sheet B3 cell.
=TEXTJOIN(" ",TRUE,TEXT(AGENDA!C2 ,"dd-mm-yyyy"),TEXT(AGENDA!D2 ,"hh:mm:ss"))
Notice that we changed AGENDA!B2 with AGENDA!C2.

Highlight Month Columns based on dates in Google Sheet

I would highlight, in Google Sheet, the columns of months based on dates in col AA:
dd/mm/yyyy (start date) - dd/mm/yyyy (end date).
Example:
Col AA ---> 25/05/2022 - 06/09/2022
The columns that must be highlighted: from May to September.
The best way is to change headers of column and put inside the first day of each month. Then apply a format as MMMM.
Conditionnal formatting formula:
=and(C$1>=EOMONTH($A2;-1)+1;C$1<=EOMONTH($B2;0))
if you can't change headers, the formula will be:
=and(MATCH(proper(text(index(split($AA2;" - ");1);"MMMM"));{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0)<=MATCH(B$1;{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0);MATCH(proper(text(iferror(index(split($AA2;" - ");2);"31/12/2022"*1);"MMMM"));{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0)>=MATCH(B$1;{"Gennaio";"Febbraio";"Marzo";"Aprile";"Maggio";"Giugno";"Luglio";"Agosto";"Settembre";"Ottobre";"Novembre";"Dicembre"};0))
You can try a much simpler formula:
=(EOMONTH(DATEVALUE("1/"&C$1);0)>$A2)*(DATEVALUE("1/"&C$1)<=$B2)
this works for current year.
If you want to use another year add it to string in DATEVALUE function, i.e. =DATEVALUE("1/"&C$1&"/2020")

G Sheets cond column-wide formatting IF the date is in next 3 days AND it is Monday

A header
B header
C header
First
01.01.2000
something
Second
02.01.2000
something
I have a sheet with B column filled with dates.
I have 4 conditional formattings: today, tomorrow and "overmorrow" dates.
The fourth condition is the following:
Mark the cell IF its date is today()+3 AND its weekday is Monday.
The simple options "date is exactly" works for "today()+2". But it declines to works with =and() formula. It should get the date type, not a boolean.
As for the formula option, I cannot invent the right formula. This doesn't work:
=and(today()+2,weekday()=2) - I believe that, when you select a non-simple option (not like date -> is exactly) it should take the real arguments, and should not contain empty function calls like weekday().
enter image description here
You should use this custom formula: =AND(B1=today()+2,weekday(B1)=2)
Sample:
Custom formula: =AND(B1=today()+3,weekday(B1)=2)
Note: I used today()+3 temporarily just to show that the conditional formatting is working since my current day is friday.

Google Sheets date calculation

Is there a way to take a date in one row and auto calculate another date in another column 10 days out?
ex: (column a) 12/11/20 -auto calculate the date 10 days from then
and put in (column d) 12/21/20.
So anytime I enter a date and need the 10 day out date it just auto calculates so I don't have to keep entering the date over and over again.
This is possible by using ARRAYFORMULA().
ARRAYFORMULA enables the display of values returned from an array formula into multiple rows and/or columns and the use of non-array functions with arrays.
Try this: =Arrayformula(TO_DATE(IF(A1:A="","", A1:A+10))).
Example:
Reference
Arrayformula()

How to split datestamp in Google Sheets

I have a datestamp in this format on A2:
18.11.2015 15:37:13
How can I split this into date and time so that I have date in A3 and time in A4?
I want to do this because datestamp does not sort properly as a number.
I found several answers to this question with various answers but none of them worked for me.
Wouldn't a simple split() be enough ? In B2:
=split(A2, " ")
Alternatively, in B2:
={INT(A2), timevalue(A2)}
Make sure to format col B as DATE and col C as TIME and see if that works?
To get the date and time in those cells you can do the following:
A3: =DATE(MID(A2,7,4),MID(A2,4,2),LEFT(A2,2))
A4: =TIMEVALUE(RIGHT(A2,8))
It's essentially extracting the essential parts for year/month/day from the string in A2 to get the needed order for date. The time is already properly formatted and can be used with Timevalue, we just need to extract the substring.
The date and time values can then be formatted in any way you want them.

Resources