how to use custom conditional formatting?

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

how to use custom conditional formatting?

Post by siamandm »

Hello All,
if i have a cell contains a function like

Code: Select all

=IFERROR(DATEDIF(TODAY(),F5,"M")&" month(s) and "&DATEDIF(TODAY(),F5,"md")&" day(s)","Expired")
and I want to highlight the cell if the result of the cell is 3 months and less
Screenshot 2020-11-06 135352.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: how to use custom conditional formatting?

Post by HansV »

Let's say the formulas are in G5:G100.

1) Select this range. I will assume that G5 is the active cell in the selection.
2) On the Home tab of the ribbon, select Conditional Formatting > New Rule...
3) Select 'Use a formula to determine which cells to format'.
4) Enter the formula

=$F5<=EDATE(TODAY(),3)

5) Click Format...
6) Activate the Fill tab.
7) Select a color.
8) Click OK, then click OK again.
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: how to use custom conditional formatting?

Post by siamandm »

thanks a lot for the reply,
where is my mistake, please?
Screenshot 2020-11-06 144414.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: how to use custom conditional formatting?

Post by HansV »

If your selection starts in O4, the formula should be

=$F4<=EDATE(TODAY(),3)

Please note that it refers to F4, not to O4!
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: how to use custom conditional formatting?

Post by siamandm »

Thanks a lot