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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

haruspication

New Member
Joined
Jan 19, 2012
Messages
17
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)
 

Forum statistics

Threads
1,181,639
Messages
5,931,158
Members
436,779
Latest member
linlaz

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
Top