Conditional formatting rule for any text string being present

wrecclesham

Board Regular
Joined
Jul 24, 2019
Messages
52
Office Version
  1. 365
Platform
  1. Windows
I use the following conditional formatting rule to highlight any dates older than 120 days:

=TODAY()-D2:D11>=120


<a href="https://imgur.com/FaPdt6P"><img src="https://i.imgur.com/FaPdt6P.png" title="source: imgur.com" /></a>

How can I modify this formula to have an additional, alternative criteria of any text string being present?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Re: =OR function always returns "FALSE"

I tried using the following formula but it continually returns a "FALSE" result, for either of the two conditions.

Code:
=OR(TODAY()-D2:D11>=120,ISTEXT(D2:D11))

However, if I try using the same two conditions individually, they work as expected and the conditional formatting rule is applied.

Code:
=TODAY()-D2:D11>=120

Code:
=ISTEXT(D2:D11)

Any ideas what I'm doing wrong when I try to combine these two conditions using the OR function?
 
Last edited:
Upvote 0
Re: =OR function always returns "FALSE"

Try this

=OR(IFERROR(TODAY()-D2,0)>=120,ISTEXT(D2))

On Applies to:

=$D$2:$D$11
 
Upvote 0
Re: =OR function always returns "FALSE"

Does this do what you want?

Excel Workbook
D
1Data
25/07/2019
36/09/2017
4
5adsas
623/06/2019
723/09/2010
828/7/19 text
928/09/2020
CF Old Date or Text
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D21. / Formula is =TODAY()-N(D2)>=120Abc
 
Upvote 0
Re: =OR function always returns "FALSE"

The IFERROR function works great.

There was a mistake in my previous comment where I said that there was only a problem in the entire OR function.

As I think you already noticed, a "#VALUE!" error (instead of a "FALSE") was returned when a text string was detected by the date logic, and that error simply gave the entire OR function a "#VALUE!" error also. The IFERROR function solves this.

This is interesting. I guess it means that an error is treated as logically identical to a "FALSE" in conditional formatting.

Thanks!
 
Last edited:
Upvote 0
Re: =OR function always returns "FALSE"

The IFERROR function works great.

There was a mistake in my previous comment where I said that there was only a problem in the entire OR function.

As I think you already noticed, a "#VALUE!" error (instead of a "FALSE") was returned when a text string was detected by the date logic, and that error simply gave the entire OR function a "#VALUE!" error also. The IFERROR function solves this.

This is interesting. I guess it means that an error is treated as logically identical to a "FALSE" in conditional formatting.

Thanks!

As the result is error then it is not TRUE.

I'm glad to help you. Thanks for the feedback.
 
Upvote 0
Re: =OR function always returns "FALSE"

Doesn't the simple CF formula in post 4 do the same job?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,891
Messages
6,175,229
Members
452,621
Latest member
Laura_PinksBTHFT

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