How to format cell based on row of dates - excel

I have a spreadsheet that is used to track hours. I am trying to change the color of the cell that has hours greater than 0 but only for those hours less than today's date based on their column.
Here is a screenshot
What I am trying to get it to do is to look like this, as the date changes each day the hours behind it are grayed out.
I can't get the conditional format formula to work. I have tried
=AND($F$25:$JB$25>0,$F$23:$JB$23<TODAY())
=IF($F$23:$JB$23<TODAY(),"",$F$25:$JB$32>0)
=AND($F$25:$JB$25>0,INDIRECT(ADDRESS(ROW(), COLUMN()-1))<TODAY())
Where row 23 is where the dates are and 25-32 are the hours
Any ideas? I'd like to do this without a macro if possible

Related

filter data between 2 dates in excel using VBA

i was wondering if someone can help. i have tried some formulas but cant seem to work this out. i have a list of data with lots of dates some duplicate dates which are fine. i have data on a daily basis from 2015-2018. my aim is to try to put a number against each week between 2 dates so Monday-Sunday representing a week. so if the date falls between to dates bring back the week number. but of course there is a long list of date ranges and week ranges. does anyone know a formula or code to read to date and look between 2 separate dates and bring back a week number
thanks
Muj
For a given date, weeknum() will return the week number:

Employee schedule - Calculate total hours from time in 1 cell; auto format time

I have an existing employee schedule excel file to which I'd like to make "smarter."
For each employee, time is entered in one cell (e.g. 7AM-3PM) for each day of the week. I would like to have the Total Hours for each employee calculated at the end of the week. I have a formula that does that, but it brings up additional problems.
=((SUBSTITUTE(B4,LEFT(B4,FIND("-",B4)+1),"")*1-SUBSTITUTE(B4,RIGHT(B4,FIND("-",B4)-1),"")*1)+(SUBSTITUTE(B4,LEFT(B4,FIND("-",B4)+1),"")*1<SUBSTITUTE(B4,RIGHT(B4,FIND("-",B4)-1),"")*1))*24
Here, the time is entered in cell B4 and this formula is pasted in the cell that you would like to have calculate the total hours.
In this formula, the time needs to be entered in the format "XX:XX AM - XX:XX PM" otherwise it doesn't work. Also if a cell is blank or says OFF, it again doesn't work. So what I would like is to automatically convert times entered in any cell as "7AM-3PM" to the format "7:00 AM - 3:00 PM."
Also, if a cell value is blank or says OFF, for it to consider the value of the cell to be "00:00 AM - 00:00 AM" but still be displayed as blank/OFF.
The way I am calculating the total hours for the week is summing up the formula above for each day (it becomes very long and I'm not sure if this is the best way to do it).
Any help for this would be appreciated.
This will take your entry and do what you want:
=IFERROR(TRIM(SUBSTITUTE(SUBSTITUTE(MID(A1,FIND("-",A1)+1,LEN(A1)),"AM"," AM"),"PM"," PM")) -TRIM( SUBSTITUTE(SUBSTITUTE(LEFT(A1,FIND("-",A1)-1),"AM"," AM"),"PM"," PM")),0)

Excel: Trying to count cells based on date, can't figure out SumIf

hopefully you can help me with this. I've been trying to figure it out in Excel myself, but I can't make the functions work and it's causing me to manually count the cells.
I've created a sample sheet on Google to show roughly what I'm trying to do;
https://docs.google.com/spreadsheets/d/18bFBvtbK-3JDj6Z6_b6NHttaytApNvdfw92ZcI4ECws/edit#gid=0
I have a series of tests my personnel have to take annually, and I want to write a function that displays the total number of tests taken within the past year. Cell B1 would be the column title, B2-4 would display the date the test was taken, and B5 is where I want the number of dates in B2-B4 that are less than one year old.
Any ideas?
If you want less than a year old from todays date then just count all values that are greater than 365 days ago,
=COUNTIF(B2:B4, ">"&(TODAY()-365))

Conditional Formatting based on weeknumber

Fellow Excel Enthusiasts,
I'm looking for a way to use conditional formatting to check if my invoice should be payed.
Added picture is how my data looks at this point in time.
What I am trying to achieve, is that when in column J the value (=weeknumber based on 25 days after date in column H) equals the week we're in, it should color the full row and keep it like this.
I've achieved the full row with conditional formatting, but still remain with 2 problems.
How to determine if this value in Column H is the same as the week we're in now? How do i keep my conditional formatting, so that when it is week 8 this row with week 7 remains coloured?
If conditional formatting is the wrong way to go, please tell me. I am learning, and would like to learn, not just a straight up answer how to fix my problem.
Using WEEKNUM you can use the following:
=WEEKNUM(H4+25, 2)<=WEEKNUM(TODAY(), 2)
The 2 in WEEKNUM indicates which day of the week to take as the first, after 1st January (which is week 1)

Conditional format of date where 3 working days greater than cell value

I am trying to adapt a number of forum posts and previous stack questions like this.
Let's say I have a date Column A2, A3, A4 etc.
I want to be able to utilize the WEEKDAY function to evaluate my condition when only in a Weekday and also 3 days greater than the date in Cell A(x).
So far my attempts have failed or I have not got the results I want. Excel is not my strongest point when it comes to conditional formula formatting.
I think it may be something like:
=WEEKDAY(A$2,2) <=5 AND 'My Cell Date' > 3 Days WHERE those 3 days are weekdays.
Also if it is possible, I want it to work like:
If day 1 of 3 is Thursday, day 2 of 3 is Friday and day 3 of 3 is Monday then apply formatting.
Could anyone help me out with this one please?
Edit not from OP to copy clarification from comments:
If the today date is 3 working days greater than the cell date change to red.
Say A2 has a received date and B2 has a completed date. The completed date is my target. Is it 3 working days greater than received.
Was not quite certain of the requirement (but seem to have hit upon an acceptable solution!):
Use =NETWORKDAYS(A2,B2)>2 under Format values where this formula is true: under Use a formula to determine which cells to format in Conditional Formatting.
NETWORKDAYS
Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays.
The syntax is:
NETWORKDAYS(start_date,end_date,holidays)
Dates should be entered by using the DATE function, or as results of other formulas or functions.

Resources