Conditional format if formula result is empty string

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
760
Office Version
  1. 365
Platform
  1. MacOS
Hi,

Re the image enclosed, I am trying to use the following formula to conditionally highlight cells when the result of the formula in the cell is not an empty string.

=COUNTIF($EQ$3:$EQ$10002,<>"")

Screenshot 2024-08-25 at 02.53.20.jpg


For some reason it doesn't work. I wonder what is it that I am doing wrong, please?

Thanks in advance!

Olly.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
The formula needs to be in the cell
then you can use a Conditional Formatting rule like this:

1724553569963.png
 
Upvote 0
The formula needs to be in the cell
then you can use a Conditional Formatting rule like this:

View attachment 115926
I have formulas in the cells. I have a very similar conditional format where i look for specific text inside “**” and that works. I just thought if I did not equal to empty then it would highlight any cell that has a string in it
 
Upvote 0
Just to be clear, I am trying to highlight cell EQ2 if the range EQ3:EQ10002 contains any cell that has a text string in it (not truly empty cells, as they all have formulas in - cells where the formula result is an empty cell). i.e. Highlight the header cell if there are any records in the range below that need attention. It's a quick warning, so that I don't have to filter or look down the column to see if there are any entries
 
Upvote 0
I have now tried this:

Excel Formula:
=COUNTIF($EQ$3:$EQ$10002,"<>")

I thought this would work, but it treats cells with formulas as not empty and highlights EQ2, despite there being no text strings in the referenced range. Is there a way to get it work so that it only highlights if the cell doesn't have a string in any cells?
 
Upvote 0
Thanks. After more research online, I have now come up with the following:

Excel Formula:
=SUMPRODUCT(LEN($EQ$3:$EQ$10002))>0

It seems to work. Basically a bit of a workaround, by counting the total number of characters in the range: if the total is more than 0 then highlight EQ2
 
Upvote 0
Solution
Did you try what I suggested?
 
Upvote 0
Did you try what I suggested?
Yes, that does work as well, but only for text. I will be using this formula for more columns, some of which only have numbers (e.g. Lat / Lon) fields, so the LEN method will work in either case.
 
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