How do i get these conditional formats correct?

V20agent

New Member
Joined
Jan 24, 2020
Messages
13
Office Version
  1. 2010
Platform
  1. Windows
I'm trying to conditional format the gantt chart based on start and end dates, but some reason its not working correctly.
if you see line 7, it starts in Jan but the section is not colored in Jan.

What am i doing wrong here?
VBA Code:
https://gofile.io/?c=kWq3g9

Appreciate the help.

Thanks
 

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"
Very few members (if any) will follow a download link provided by someone who has only just joined the forum.

You can use xl2bb to post your data sample directly to the forum.
 
Upvote 0
Can you post some sample data using the XL2Bb add-in?
 
Upvote 0
ah ok im sorry i didnt know how to post it.

basically have this formula in the conditional formatting to color the cells based on the date ranges
=AND(E$5>=$B6,E$5<=$C6)


here it goes

simple-gantt-chart_ms.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1
2
3Display Month1/31/2020
4 2020 2021
5TaskStartEndJanFebMarAprMayJunJulAugSepOctNovDecJanFebMarAprMayJunJulAugSepOctNovDec
6block block1-Jan-206-Dec-20
7blb15-Jan-2025-Feb-20
8bolb 11-Jan-2030-Jun-20
9block 315-Jan-2022-Jun-20
10block 515-Mar-2023-May-20
11block 61-Mar-2030-Dec-20
12block 391/2/20206/22/2020
13
14block
15block 182/25/20209/30/2021
16
17
18
19
Sheet1
 
Upvote 0
Thanks for that, how about
=AND(E$5>=EOMONTH($B6,-1)+1,E$5<=$C6)
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,814
Messages
6,121,711
Members
449,049
Latest member
THMarana

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