How to highlight entire column based on time value in Google Sheets - google-sheets

I have a google sheet where the columns are 15 min intervals from 8am to 6pm. I'm basically making a daily gant chart by 15 min intervals. Tasks are down the left-hand side. I fill in the cells for the task based on how long they should be in. Each task gets a different color. I've set the sheet to auto-update every min.
What I'd like to do is highlight the entire column based on the current time and the time value in the column itself to show where we are in the day. Later then I'd like to fine out what cell in that entire column has colored background and highlight the task in column A as it shows that's what task you should be working on.
Any thoughts on how to do this? Would I have to make a conditional on all 32 columns? What would that conditional look like? I'm using 12 hour not 24 hour clock.

Assuming you are using actual time values (not Text format) in B1:AO1, please try clearing formatting from ColumnsB1:AO, selecting them and Format, Conditional formatting..., Format cells if... Custom formula is and:
=and(B$1<=1*TEXT(now(),"HH:MM am/pm"),B$1>(1*TEXT(now(),"HH:MM am/pm")-1/96))
Then select fill of choice and Done.
For the "Later" part I am confused by the colouring you want as opposed to the colouring you have.

Related

How can I set a cell to highlight after X hours have passed in Google Sheets

I have a Google Sheet where a column is filled with times in a 24 hour format (XX:xx), how can I select a cell to highlight red after 3 hours have passed with conditional formatting?
I've been trying to mess with the Now() command in custom formulas for like 2 hours now, but I can't seem to get it to work. PLZ HELP!
To Highlight cells if exactly 3 hours 03:00:00.000 have been passed you need to paste this formula in format>conditional formating. > format cell if - Custom Formula, take a look at the example in this sheet.
=ArrayFormula(IF(A3:A="",,IF(A3:A-NOW()>0.13,"True","False") ))
A3:A-NOW()>0.13 to check if the date in the range A3:A minus NOW() is greater than 0.13 which represent an hour 03:00:00.000 as a number.
To check and highlight cells when certain duration have been passed and be able to adjust the duration from a cell you need to paste this formula in cell B2 to get True or False output.
=ArrayFormula(IF(A2:A="",,IF(A2:A-NOW()>$E$2,"True","False")))
It can be used as a formula in format>conditional formating.
take a look at the example in this sheet.
the columns highlighted in blue is for demonstration it can be deleted.
For anyone who has the same issue, it has been solved. Looks like the Now() call requires both the time and date to be inside the cell in order to work.
The formula I used to highlight cells that are older than 3 hours is
=(Now()-TIME(3,0,0))
A friend also showed me a different formula that seems to do the same thing
=IF(NOW()>A2+3/24,TRUE(),FALSE())
You can change the time by changing the (3,0,0) to Hrs,Min,Sec of your choosing, for the second formula, you can change it by adjusting the fraction value (3/24 for 3 hours, etc)
These will only work if you have the date and time in the cells you are formatting (e.g. If you timestamp with Ctrl+Alt+Shift+;) it will not work if you timestamp with just the time (Ctrl+Alt+Shift) as that seems to set the year to 1899 for some reason.
It would be nice if I could get these working without a date, but I have not found a way to do that.

Excel/Sheets Formula for "If addition of two times is between 00:00 and 7 am display time in red, if not display time in black"

I'm trying to reference multiple time additions and subtractions. Essentially I've got Cell A that is a date and time and constantly changing and Cell B that is a time that changes too. Then Cell C that displays Cell A + Cell B. I want to make if Cell C is a time between midnight and 7 am display the time in Red font. If not display the time in Black font.
Here is an example Sheet https://docs.google.com/spreadsheets/d/1Qjr2JzC42z3sxqH7Rz4BSMsAMv1LIAZH3gES9fYeY0g/edit?usp=sharing . The date and times on the left must add a time on the right, but then also check to see if its a specific time (date doesn't matter) and if it's between 00:00 and 7:00 then show the specific date and time in red otherwise black. I think the answer may have something to do with conditional rules and I found this article indicating changing font colors in excel but the formula comparing specific times I'm stuck on.
I've tried to make an example formula in a cell without conditional rules to check to see if I can make it work by doing =IF(AND(C5>=MIN(P5:P47),C5<=MAX(P5:P47)),"YES","NO") but thats not working. I also came across this formula which may help =AND(val>MIN(NUM1,NUM2),val<MAX(NUM1,NUM2)) but am unsure at this point.
---EDIT---
Figured it out using a conditional format =AND(HOUR($C5)>=0,HOUR($C5)<=7)
I actually just Figured it out with Conditional Format =AND(HOUR($C5)>=0,HOUR($C5)<=7)
Add A1 and B1 in C1 and then use Conditional formatting with a custom formula in C1.
=TIME(HOUR(C1), MINUTE(C1), SECOND(C1))<0.29
You can choose the custom format to be a red font.
try:
=TIMEVALUE(C1)<=TIMEVALUE("7:00:00")

Google Sheet conditional formatting

I'm trying to get a format: I want the cel in column A be orange when the date is past and the task is nog checkt done. This is working, but he formats my hole range. A second formatting with a Cel is blank doesn't work. If there is no task i don't want it to be orange..
The problem comes from the $ in your formula
It formats all cells based on row 4.
Additionally, if you want to implement the condition that the date should not be blank, you need to add into your AND statement ISBLANK(D4)=FALSE
Change your formula to
=AND(D4<TODAY(),E4=FALSE,ISBLANK(D4)=FALSE)

Change the background of one google sheets column based on the date in another column

I've seen lots of answers for various other conditions under which to do this. However I can't seem to modify any of these to work for a date range. What I want is for the column color of column E to change if the date in column H is between today and 5 days from today.
I've tried varying versions of this formula: H3:H150 =today() +5 with no success
This doesn't give me the range of between now and 5 days from now but I could do multiple rules like this and just go down on each one(=today() +4, =today() +3, etc) but obviously I need this rule to work first.
Thanks!
Conditional formatting is more helpful than you seem to be expecting. Clear formatting from the column to be formatted, select it and Format, Conditional formatting..., Format cells if... Custom formula is and:
=and(H1>today(),H1<today()+6,H1<>"")
Then select fill of choice and Done.
This should format the next five days (change the angled brackets around for the past five days).
Setting the range is achieved with selection of the column to be formatted (not the one with dates in it - H). If only to apply to Rows3:150 (and in general it is a good idea, for speed of processing, to restrict the ranges to which CF is applied) then either start by selecting Rows3:150 in the column to be formatted (instead of the entire column) or adjust the Apply to range for the rule, but in either case use H3 in place of H1 in the formula above.
CF should automatically apply the rule as written to the first row in the selected range and then adjust it for the second and subsequent rows in the way copying down would adjust the formula (if at all) were it in a cell in the sheet.

Dimensions of a merged cell (as in number of cells merged vertically and horizontally)

I am trying to make a schedule in Google Spreadsheets. One of the features I want here is to have the current activity highlighted based on the time of the day.
In the formula below, understand A as the column that contains times (first column on the picture), and B as the column that contains activities.
=AND(B$1=upper(TEXT(TODAY(), "DDDD")), (TODAY()+$A2)<NOW(), (TODAY()+$A2+(0.5/24))>NOW())
B$1=upper(TEXT(TODAY(), "DDDD")) checks that the day indicated at the top of the column is today
(TODAY()+$A2)<NOW() checks that the time is more that what's in the A column on the same line
(TODAY()+$A2+(0.5/24))>NOW() checks that the time isn't more than half an hour past what's in the A column on the same line
Using this conditional formatting formula, I obtain a decent result (see picture), but when it reaches a merged cell, it'll only work for the first half hour (in this picture, lunch will only be highlighted from 12:00PM to 12:29PM).
To correct that, my idea is to multiply 0.5/24 in the last part of the formula by the height (as in number of cells in height) of the merged cell
Is there a way to do this in Google Spreadsheets?

Resources