Date Highlight Formula Excel conditional formatting - excel

I making a leave Planner which highlight the calendar as per the dates
using these formulas
=IF(B6="",FALSE,SUMPRODUCT((B6>=INDIRECT("Table1[Start]"))*(B6<=INDIRECT("Table1[End]"))))
=IF(B6="",FALSE,SUMPRODUCT((B6>=INDIRECT("Table1[SD1]"))*(B6<=INDIRECT("Table1[ED1]"))))
I want to apply this formula on same row not on columns how i can give range of Rows or range of cells containing start dates and end dates so same color highlight for one row and other color for other row

The formulas would be:
=OR(SUMPRODUCT((B6<>"")*("abc"=INDIRECT("Table1[Names]"))*(B6>=INDIRECT("Table1[Start]"))*(B6<=INDIRECT("Table1[End]"))),SUMPRODUCT((B6<>"")*("abc"=INDIRECT("Table1[Names]"))*(B6>=INDIRECT("Table1[SD1]"))*(B6<=INDIRECT("Table1[ED1]"))),SUMPRODUCT((B6<>"")*("abc"=INDIRECT("Table1[Names]"))*(B6>=INDIRECT("Table1[SD1]"))*(B6<=INDIRECT("Table1[ED1]"))))
As you can see you will need to have a different rule for each name. And change the name.

Related

Excel Conditional formatting Dates older then 60 days

I'm trying to use one Conditional formatting rule that does the following:
Ignore Blank Cells
Ignore Cells that do not have a date value
Highlight Dates that are going to expire in 30 days
So i have a list of dates:
07/25/2021
06/25/2021
05/25/2021
etc...
i used the custom formula under conditional formatting and used the following codes:
=CountIF(A:Z,today()-30)
i also used
=CountIF(A:Z,"<="&today()-30)
both codes highlight blank cells, i tried using the IF statements or IsBlank statements but i don't think i fully understand how those work. because i made a mess.
regardless of what i do, cells that are non-dates and blank cells are highlighted.
i even tried using the the conditional formatting rule, "Format only cells that contain" and i added the following:
Format Only cells with:
Cell value - less than or equal to - Today()-30
what do you guys think im doing wrong?
Assuming that your dates are in column B:
Select entire column B.
From menu start Format / Conditional formatting...
Add a new rule with the plus sign.
At Style select Classic.
After select Use a formula to determine which cells to format
Enter this expression: =AND($B1<>"",$B1<=TODAY()-30)
Select a desired formatting.
You can easily adjust this to row or any other range, or +30 days etc.
If you need more columns, select all of them, and assuming that the first column is A, the formula should be: =AND(A1<>"",A1<=TODAY()-30). See the screenshot below with formula and some example data:

With Excel Conditional Formatting - Want to Highlight Cells in a range that match any from another range of cells

Sheet One has 5 cells in a row with numbers. (A2:F2)
Sheet Two also has 5 cells in a row with numbers. (A3:F3)
I'd like to highlight sheet one's cells yellow every time that sheet two has a matching number entered. (There will be more rows of data added to each sheet, but I am using the first row only, to keep it simple.
It works with creating a CF equals to, but I need something that applies to a range of data, from a range of data to make this less tedious. Thank you for any tips!
I am using conditional formatting. I have tried Vlookup, Match, and Countif, but I am new to this type of formatting.
(Sheet two's numbers can be placed in a list (column), instead of a row, if that matters)
I'd suggest using COUNTIF:
=COUNTIF(Sheet2!$A:$F,A2)>0
Snapshot of Sheet1 and the Conditional Formatting:
Snapshot of Sheet2:

Conditional formatting based on cell in different column but same row

I apologize if this has been posted, but I haven't found a solution that works.
I have an excel sheet with a lot of data.
I want to make the cells in a certain column (column CG) turn purple if the value of a cell in a different column, but equal row is "no". For example, I want the cell in column CG row 140 to turn purple if the cell in column CS row 140 is no. I want this to happen for every cell in the column. I tried to set up a conditional formatting rule such that the rules applies to =$CG$4:$CG$200 and for the formula I've tried $CS=no, $CS="no" $CS4="no" and $CS4=no with the formatting just being a purple highlight. I've tried hitting apply and ok, but nothing works.
I used these link to determine what to do for my rule.
Conditional formatting based on other column
Excel Conditional Formatting based on Other Column
Any suggestions?
Simply highlight the entire column "CG" then open the CF dialog.
Select the option Use a formula to determine which cells to format and type in the following formula:
=$CS1="no"
Then proceed to set your formatting, in your case, a purple fill.

Excel Conditional Formatting - Highlight blank cells between

thanks in advance for the help.
I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. I am struggling with the conditional formatting formula to highlight the desired dates.
Here's a screen shot of how the chart is set up
I am able to highlight the column of the cell containing the WW value (e.g. in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW.
Most formulas (that I know) work on the value of the cells rather than their location or index. I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient.
I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I.
Any suggestions on how to approach this is greatly appreciated!
Attached is a screenshot of my structure with my conditional formating working as required. You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule:
=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight
Entered into cells $B$3:$V$6. Of course, in your case you'd have to change it to something like:
=COUNTA($B$2:B$2)+41-3=$A$1
Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). Also the header for the work week has to be a numeric value, but you can play around this to get what you need. Let me know if you'd need further help.
You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. The WEEKNUM() formula gives you exactly what you need.
If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting:
=$B$2=WEEKNUM(D$1)
See attached photo.

Excel Macro to Copy and Paste Format Line by Line instead of range of cells

I am using conditional formatting in Excel 2007 to compare values row by row in cells H, K and U.
Since I am trying to use the conditional fomartting row by row instead of a range of cells.
My hand cramped up by row 50, and I have another few hundreds to go.
Is there a macro that would check the rows and paste the format without having to do one at a time?
A million thanks.
You don't need to apply the conditional formatting row-by-row. If you use the proper combination of relative and absolute references in your conditional formatting formula, you can do it all in one shot. For example, select A1:C10 and enter this formula for conditional formatting
=$A1=1
Because I made the column absolute with the dollar sign, every cell in A1:C10 will refer to column A. But since the row is relative, every cell will refer to column A on its same row. So B8's conditional format formula will be =$A8=1

Resources