I am trying to build a sleep tracker in Google Sheets (link). The idea is to select a year and a month from a drop-down list in cells A1 and A2, which would then populate columns based on the number of days in that month. I have tried different formulas that I found on stack overflow and elsewhere, but could not get them to work.
In short:
I am looking for a formula that will populate the columns with days of that month and a name of the day in a row bellow.
Looking for a way to summarize the time of sleep at the end of the each day, based on a ticked checkbox.
I am not sure how the year and month selectors should be formatted (as plain number or a date).
Is there a way to automatically insert check-boxes to the days of the month?
This is the formula that I have tried to adjust:
=INDEX({TEXT(SEQUENCE(1; DAY(EOMONTH(A2&"/"&A1;0)); A2&"/"&A1; 1); {"d"; "ddd"}); {"Total"; ""}})
But it returns with "Error In ARRAY_LITERAL, an Array Literal was missing values for one or more rows."
Please note that ";" is used as an argument separator instead of "," (regional settings).
Thank you in advance!
I think that with a very small adaptation and date formatting you'll be able to easily do it. First with your selector in A2, you could set it as actual dates, but format them as mmmm:
Then, repeat the sequence in both rows starting in C2 and C3:
=SEQUENCE(1,DAY(EOMONTH(A2,0)),A2)
But formatting row 3 as ddd:
PS: yes, you can do row 3 with TEXT and INDEX. Choose your preferred one:
=INDEX(TEXT(SEQUENCE(1,DAY(EOMONTH(A2,0)),A2),"dddd"))
UPDATE with TEXT VALUES
Return to your previous A2 dropdown and try this, using MATCH to find the number of the month, and DATE to locate the correct beginning of the month in that year:
For row 2:
=SEQUENCE(1,DAY(EOMONTH(DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1),0)),
DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1))
For row 3:
=INDEX(TEXT(SEQUENCE(1,DAY(EOMONTH(DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1),0)),
DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1)),"dddd")
)
I have a personal finances Google Sheet with all my expenditures (column A) and corresponding dates (column B) of the month when they are due to be paid.
I would like to create a formula that shows me what is left for the remainder of the month depending on what day of the month I am looking at the sheet.
Something like, ifDate is today, sum all remaining dates of the month expenses.
TIA
Use this formula it works even if the dates is disordered.
=SUMIF(C2:C,">"&F2,B2:B)
Update
=SUMIF(D3:D,">"&TODAY(),C3:C)
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")
How can I highlight cells in Google Sheets if current month?
The cells have Jan-2017, Feb-2017 etc. and not dates.
I just want the current month highlighted so that the rest of the team can keep track of our monthly stats.
I'm supposing the column that has the months is A, and that the actual values of each cell is the first day of each month (so 2/1/2017 for February for example).
Select where you want the conditional formating to go, and open the conditional formatting sidebar.
Choose "Custom Formula" from the dropdown, and paste the following in:
=$A:$A=(today()-day(today())+1)
What we are doing here is:
=A$:A$ - Look in column A for the following
today() get todays date
-day(today()) get the day and subtract it from the today in the previous point
+1 add 1 to the result because 2/8/2017 - 8 = 2/0/2017, which google sheets actually recognizes as 1/31/2017, so by adding 1 it will become 2/1/2017 which is what is wanted.
The result of this sum is then compared to the data found in A$:A$ and the results which match the sum (today()-day(today())+1) are highlighted.
Just for the record, this may work as well using conditional formatting's custom formula:
=month($A:$A)=month(today())
Considering the dates are in the column A
currently I have a spread sheet of dates. A1 is todays date 3 years ago.
A3:A20 are various dates when employees gained their first aid certificate.
When any cell in A3:A20 is less than A1 it would mean their certificate is out of date. I would like it to be highlighted.
Does anyone have any ideas? mine have all failed :)
Something like this should work in new google sheets.
In cell A1 put in todays date by using
=Now()
Go to Format, conditional formatting
Select custom formula is
Enter
=datedif(A$3:A$20,$A$1,"Y")>3
Select your colour, such as red, then finally in the range. put A3:A20