Cond. format empty cell based on column header and dates in other cells

haruspication

New Member
Joined
Jan 19, 2012
Messages
17
Hello excel enthusiasts,

I want to use a conditional formatting formula to highlight empty cells that fall between the first and last harvest period for each crop based on the column header date. The cells that should be highlighted say "fill". I've tried if/and formulas using relative cells, but haven't gotten it to work. Any suggestions?

For example, I applied conditional formatting to cell D2:J2 with the formula below, but nothing happened: =AND(D$1>=$B2,D$1<=$C2).


ABCDEFGHIJ
1CropFirst HarvestLast Harvest10-Apr17-Apr24-Apr1-May8-May15-May22-May
2Asparagus17-Apr8-Mayfillfillfillfill
3Turnips1-May15-Mayfillfillfill

<tbody>
</tbody>
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I figured it out! In my formula, excel did not convert the column header dates into serial numbers, however excel did convert the dates in column B & C into serial numbers. So, I adjusted the formula so that the column header dates became serial numbers and the formula worked perfectly.

AND(datevalue(D$1)>=$B2,datevalue(D$1)<=$C2)
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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