Formula for conditional formatting.

OaklandJim

Well-known Member
Joined
Nov 29, 2018
Messages
849
Office Version
  1. 365
Platform
  1. Windows
Team Mr. excel

I need to use conditional formatting to create a Gantt chart worksheet.

I am using this formula -- which works in worksheet cells --
Excel Formula:
=ISNUMBER(MATCH(TEXT(rcDayDate,"ddd"),WorkDaysInAWeek,0))
to determine if the "current" date in the Gantt chart plot is a workday.

rcDayDate is a name whose RefersTo is a basic relative column address like L$5. For a given cell within the Gantt chart range it refers to the cell containing the "current" date (the date being processed for the Gantt bar plot). WorkDaysInAWeek is merely a named range containing a list of day names that are within the workweek like "Mon","Tue","Wed","Thu" for a four day workweek.

As I said above, the formula works (returns true or false) when used in cells. But when using the formula for conditional formatting it does not seem to evaluate to true or false.

Is my formula not acceptable for conditional formatting?

I really appreciate your assistance.

Jim
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
What a knucklehead I am. The formula works as expected. I was trying to set the cell conditional color using the Pattern Color, not the Background Color. It has been a while since I used conditonal formatting AND I'm geting old. Thanks.
 
Upvote 0
What does your WorkDaysInAWeek named range definition look like? Is it absolute?
I tried your formula and it works fine.

Another way to check if it is a working day is:

Excel Formula:
=WORKDAY(L$5-1, 1)=L$5

And you could take holidays into account like this:

Excel Formula:
=WORKDAY(L$5-1, 1, Holidays)=L$5

being Holidays a named range of all the holidays dates.
 
Upvote 0

Forum statistics

Threads
1,221,292
Messages
6,159,056
Members
451,534
Latest member
zooster

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top