Gantt Chart with Conditional Formatting based on two conditions

prvince

New Member
Joined
Aug 16, 2016
Messages
3
Hi there,

I need help with a formula to apply conditional formatting based on two conditions. The data I am referring to is shown in the table below. The formula for the conditional formatting should format a cell based on the classic green, yellow, red formats when the row and column dates match and the status is posted (green), not yet posted (yellow) and not posted (red). I've put in brackets what the outcomes should be in the table below.

ABCDEFG
1Name & ProductPublish DateStatus16-Aug-1623-Aug-1630-Aug-1606-Sep-16
2Joe Bloggs
31. I Am Bloggs T-shirt16-Aug-16Posted[GREEN]
42. Bloggs Denim Jacket23-Aug-16Posted[GREEN]
53. I love Bloggs Underwear30-Aug-16Not Posted[RED]
64. Bloggs 4ever socks06-Sep-16Not Yet Posted[YELLOW]

<tbody>
</tbody>





















The formula I'm using in D3 (and copied and pasted to the other cells) is as follows but no formatting appears in the cell or other cells.

="AND(D$1=$B3,$C3=""Posted"")" [GREEN]
="AND(D$1=$B3,$C3=""Not Yet Posted"")" [YELLOW]
="AND(D$1=$B3,$C3=""Not Posted"")" [RED]

Can anyone help please? Many thanks in advance.

P.S. Not sure if using Excel 2011 for Mac makes a difference...
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hello there,

In conditional formatting you can select new rule and apply these three rules for every cell
=IF(SUMPRODUCT((B3=$D$1:$G$1)*(C3="Posted"))=1, "True") and set the format to green
=IF(SUMPRODUCT((B3=$D$1:$G$1)*(C3="Not Posted"))=1, "True") and set format to red
=IF(SUMPRODUCT((B3=$D$1:$G$1)*(C3="Not Yet Posted"))=1, "True") and set format to yellow

hope it helps
 
Last edited:
Upvote 0
Hello there,

In conditional formatting you can select new rule and apply these three rules for every cell
=IF(SUMPRODUCT((B3=$D$1:$G$1)*(C3="Posted"))=1, "True") and set the format to green
=IF(SUMPRODUCT((B3=$D$1:$G$1)*(C3="Not Posted"))=1, "True") and set format to red
=IF(SUMPRODUCT((B3=$D$1:$G$1)*(C3="Not Yet Posted"))=1, "True") and set format to yellow

hope it helps

Thanks Constantinos! It's such a clever formula and I definitely wouldn't think of something like this. I made a tweak to it because the current formulae would fill in all the cells because the $D$1:$G$1 would be true in all cases. This is what I used in the end:

=IF(SUMPRODUCT(($B3=D$1)*($C3="Posted"))=1, "True") and set the format to green
=IF(SUMPRODUCT(($B3=D$1)*($C3="Not Posted"))=1, "True") and set format to red
=IF(SUMPRODUCT(($B3=D$1)*($C3="Not Yet Posted"))=1, "True") and set format to yellow

This allows me to copy and paste, or drag, the formula to adjacent cells and the cell references would automatically update.

Anyway, I really appreciate the quick response and help! Thank you :)
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,702
Members
449,331
Latest member
smckenzie2016

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