Conditional Formatting, based on multiple values

russelldt

Board Regular
Joined
Feb 27, 2021
Messages
160
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I am using the following of format task durations in a simple Gantt chart:

=AND(task_end>=K$5,task_start<L$5). This condition gives me a colour to format the row between the task start and task end dates. (row 5 being the days)

The additional criteria I want to add is that the colour of the task bar must be dependent on the value in column C, meaning that if C=Tom, the task bar colour is (say) red, and if it is Harry, the colour is Green, and so on.

Any help would be appreciated
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You would need to create a separate rule for each colour.
 
Upvote 0
You would need to create a separate rule for each colour.
Thanks Fluff, I have the 2 rules, but I am struggling with the formula to determine which Colour to apply.
I have tried the following conditions, and I don't get the correct result.


=IF(AND(task_end>=K$5,task_start<L$5),$C$7="Tom")
=IF(AND(task_end>=K$5,task_start<L$5),$C$7="Harry")
 
Upvote 0
They should be like
Excel Formula:
=AND(task_end>=K$5,task_start<L$5,$C$7="Tom")
 
Upvote 0
Solution
Glad to help & thanks for the feedback.
 
Upvote 0
What do you mean?
Why is it $C$7="Tom" and not the whole column?
Screenshot 2023-02-06 at 21.14.21.png
 
Upvote 0
Because that is what the OP was using.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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