Conditional Formatting

liampog

Active Member
Joined
Aug 3, 2010
Messages
294
Hi

I have the following data on a sheet. It is basically a calendar that shows a persons days off.

Role 0 are fixed days off people. Role 1 is to be ignored.

I want a conditional formatting to be true when the following are satisfied:

1. Column B = 0
2. If the day (Row 1) for the corresponding date is TRUE in Columns C to I.

I can't figure out what formula I need to put into the conditional formatting.

The columns extend beyond Column W up to the last day of the year (so 365/366 columns in total).

I've placed X in the cells that I want to colour (there won't actually be any data in the cells and the X's are just to clarify the cells which will be true in the conditional format).

I hope I've worded this clearly.

Thanks
Liam

ABCDEFGHIJKLMNOPQRSTUVW
1NameRoleMoTuWeThFrSaSuMoTuWeThFrSaSuMoTuWeThFrSaSu
21/12/13/14/15/16/17/18/19/110/111/112/113/114/1
3Joe Bloggs0TRUETRUETRUExxxxxx
4John Smith1
5Alan Jones0TRUETRUETRUExxxxxx
6John Doe0TRUETRUETRUExxxxxx
7Mary King1
8James May0TRUETRUETRUETRUExxxxxxxx

<tbody>
</tbody>
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
10,201
Office Version
2007
Platform
Windows
The formula is based on the date you have in cell J2, since the day in J1 is incorrect, it should be Tuesday.

Change 8 for the last line with data.

=IF($B3=0,1)*INDEX($A$1:$I$8,MATCH($A3,$A$1:$A$8,0),MATCH(LEFT(TEXT(J$2,"ddd"),2),$A$1:$I$1,0))

Change W for the last column with data.
Applies to:
$J$2:$W$8
 

liampog

Active Member
Joined
Aug 3, 2010
Messages
294
Hi Dante

Thanks, that's brilliant, and actually the formula makes perfect sense to me :) just couldn't work it out for myself.

To be honest, I just made the days and dates up so was able to modify the formula to work correctly.

Thanks again
Liam
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
10,201
Office Version
2007
Platform
Windows
I'm glad to help you. Thanks for the feedback.
 

Forum statistics

Threads
1,089,555
Messages
5,408,921
Members
403,243
Latest member
psabin8951

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top