I have been trying to use conditional formatting to create a Gantt chart. So far I have not been very successful. Here is a screenshot of part of the chart:

The current formatting is hand made.

I want the cell to turn pink if it meets the following condition:

The week number (in row 4 of current column) must be greater than or equal to the start week (in current row column D) AND smaller than or equal to the end week (in current row column E).

I have tried to add conditional formatting with a formula. The formula I came up with looks like this:

```
=IF(AND(ADDRESS(4,COLUMN(),2)>=ADDRESS(ROW(),4,1);(ADDRESS(4,COLUMN(),2)>=ADDRESS(ROW(),5,1)))
```

Can someone tell me what I did wrong and how to fix it?

## Best Answer

there is all sorts wrong, unfortunately!

`ADDRESS`

gives you the address of the cell, not its value... so you are comparing whether an address is bigger/smaller`>=`

rather than one greater and one less than`,`

and`;`

(but I guess that is probably just editing onto this site!)To enter the formula:

`F6`

`=AND(F$4>=$D6,F$4<=$E6)`

To explain:

`$`

in the address