Coloring Cells when Date is inputed

Sam Lam

New Member
Joined
Aug 17, 2023
Messages
6
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi all,

I would like to colour the cells in between the start and end date automatically once i got the dates from the user. Any idea on how to do it?
1692343709485.png
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the MrExcel board!

You will generally get better/faster help if you can provide board members with sample data that they can easily copy from.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

See if using Conditional Formatting like this does what you want.

23 08 18.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
120-Jul21-Jul22-Jul23-Jul24-Jul25-Jul26-Jul27-Jul28-Jul29-Jul30-Jul
2DNDNDNDNDNDNDNDNDNDNDN
323-Jul26-Jul
42-May5-Jun
5
623-Jul23-Jul
Colour cells
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E3:Z6Expression=LET(d,LOOKUP(9^9,$E$1:E$1),AND(d>=$A3,d<=$B3))textNO
 
Upvote 0
Solution
Hi Peter, I have pasted the formula into the conditional formatting bar but nothing seems to work. (I dont have a strong good foundation in excel and this is my intern job :/) May I know if I have messed up something?
1692345519665.png
 
Upvote 0
We cannot see your rows & columns. Can you post the sample data with XL2BB as suggested earlier?
 
Upvote 0
Hi Peter, the laptop is under company's supervision and it says cant be opened in protected view. However I have this larger screenshot of the file. Hope it helps.
1692346298932.png
 
Upvote 0
says cant be opened in protected view.
For next time, review the "Known XL2BB issues" near the top of the instructions. That will likely resolve that issue.

For now,
  • remove the CF from the worksheet (Conditional Formatting -> Clear Rules -> Clear Rules from Entire Sheet)
  • Select from F4 to whatever your last column is & down to row 17. Just check that F4 is the active cell
  • Apply the CF as shown below

23 08 18.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1
220-Jul21-Jul22-Jul23-Jul24-Jul25-Jul26-Jul27-Jul28-Jul29-Jul30-Jul
3DNDNDNDNDNDNDNDNDNDNDN
423-Jul26-Jul
52-May5-Jun
6
723-Jul23-Jul
8
Colour cells
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F4:BA17Expression=LET(d,LOOKUP(9^9,$F$2:F$2),AND(d>=$B4,d<=$C4))textNO
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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