conditional format color

yanyanyan

New Member
Joined
Nov 13, 2014
Messages
24
[TABLE="width: 500"]
<tbody>[TR]
[TD]Expiry Date[/TD]
[TD]2014[/TD]
[TD]2015[/TD]
[/TR]
[TR]
[TD]31/11/2014[/TD]
[TD](black color)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]31/12/2014[/TD]
[TD](black color)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]31/01/2015[/TD]
[TD][/TD]
[TD](black color)[/TD]
[/TR]
[TR]
[TD]25/05/2015[/TD]
[TD][/TD]
[TD](black color)[/TD]
[/TR]
</tbody>[/TABLE]
Hi Everyone,
Can someone please let me know who can i make those cell black or whatever color if the expiry date falls in the period? Thanks
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
hi.

use a formula to conditional format desired cells.

assuming B1 houses 2014
formula for column B is:
Code:
=YEAR($A2)=$B$1

and assuming C1 houses 2015
formula for column C is:
Code:
=YEAR($A2)=$C$1
 
Upvote 0
select the area to apply the colour B2:C5 - in your example

then use in conditional formatting the following formula

=YEAR($A2)=YEAR("1/1/"&B$1)

and format the fill colour

Excel Workbook
ABC
1Expiry Date20142015
230/11/2014(black color)
331/12/2014(black color)
431/01/2015(black color)
525/05/2015(black color)
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B21. / Formula is =YEAR($A2)=YEAR("1/1/"&B$1)Abc
 
Upvote 0
hi.

use a formula to conditional format desired cells.

assuming B1 houses 2014
formula for column B is:
Code:
=YEAR($A2)=$B$1

and assuming C1 houses 2015
formula for column C is:
Code:
=YEAR($A2)=$C$1

thanks for the reply, however i got #value! back, can you please help, maybe i did something wrong?
 
Upvote 0
hi.

use a formula to conditional format desired cells.

assuming B1 houses 2014
formula for column B is:
Code:
=YEAR($A2)=$B$1

and assuming C1 houses 2015
formula for column C is:
Code:
=YEAR($A2)=$C$1

Thanks i got it now, there isnt 31/11/14 hahaha thank you!!!!
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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