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 one date in C4. And I have dates calculated in Column I.
I am trying to highlight with conditional formatting any date in column I that is before the date in C4 and within the next 45 days of today.
Criteria 1: Date in Column I is sooner than date in cell C4
Criteria 2: 45 days or less from today = True
This is the formula I have so far, but can't seem to get working correctly -
=AND(C4>TODAY(), C4-TODAY()<=45)
I can get the formula to work on a single cell as follows:
=AND($C$4>$I$13, $C$4-TODAY()<=45)
I tried to copy down, but that just gets it to apply to the entire the formatting to the entire column
Solution:
=AND(I4<$C$4,ABS(I4-TODAY())<=45)
Was able to apply this range to the whole column and where you see I4, the formula would update to the relative cell. Interesting Note, I had been trying this in 2010 but in reverse (subtracting c4 from today) and was having trouble with the formula not saving without automatically adding absolute cell references.
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
Is it possible in Google sheets to have a formula which looks at a certain date and creates a range of dates based on it?
I have this google sheet:
https://drive.google.com/open?id=1ccLwh_ExEtE2zxYUor9hxi1hMyADQtuUgyCyOKASxIk
Is it possible to have formulas in the left column rows to just look at the date string "august" and automatically fill in the dates down each row? Preferably with this format I have in this sheet? Like:
monday
1
Tuesday
2
Wednesday
3
I know it's possible to format a date so it ways monday 1 e.g, but for some reason, google sheets doesn't text wrap dates and I want a line break between the day and number, if possible.
Any help truly appreciated!
Since tagged [excel-formula]:
=TEXT(WEEKDAY(DATEVALUE(1&"August"&2016)+ROW()-1),"dddd")&CHAR(10)&ROW()
in Row1 and copied down to suit should work. (For just Google Sheets this Q probably belongs on Web Applications.)
The month selection is hard-coded into the formula but could be parameterized.
I have this planning sheet I am working on: https://docs.google.com/spreadsheets/d/1GQpZh0MOotBl_iAucGm_LnK8shIKjjgukGqaFVvGKF8/edit?usp=sharing
As you can see events are planned out on a sort of calendar look.
I will be using this every day and I would like it to highlight the current date to me automatically. I've highlighted today's date manually.
Do you see any way to do this?
It does not need to be the whole column it can just be the day number and week of day on the top if it's easier.
I would greatly appreciate any help you can give me regarding this!
Thanks a lot.
Balint
I found this question when searching for a way to highlight a whole column/row.
Here's the way to do it:
Apply to range: A1:Z1000 (this is the range of all columns/rows including the dates)
Format cells if...: [Custom formula is]
Formula (for columns): =A$1=TODAY()
Formula (for rows): =$A1=TODAY()
The dollar sign ($) will keep the reference cell fixed. So if the formula uses A$1 it takes A1, B1, C1 etc to look for the date and then highlights the entire column A, B, C etc.
If the formula uses $A1 it takes A1, A2, A3 etc to look for the date and then highlights the entire row 1, 2, 3 etc.
Just make sure that "range" covers the entire rectangle of cells and not just one date. It's easy to adapt if your dates are in a different row/column.
Hope this helps the next person who comes here with a similar problem :)
You would have to use conditional formatting
on the column with the dates. Rule should be "Date is today". Choose a color to your likings.