Don't COUNTIF if adjacent cell is blank

Itsmeerc

New Member
Joined
Oct 19, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I am currently working with a fairly simple COUNTIF formula in the attached image. The count in column L is based on =COUNTIF(G:G, K8) and so on.

The problem I have is that the ward list in column K is drawn from a separate sheet in the workbook, using ='Select LA'!C5 and so on, and updates based on this, getting longer or shorter. I therefore want to copy the =COUNTIF formula in column L down so that it will continue to provide a count when the ward list gets longer. However, using this formula when the adjacent cell is blank gives the value 1042652.

So, my question is, what formula can I use in column L that will count column G, based on column K, but will not return a value if the adjacent cell in column K is blank.
Thanks.


Screenshot (11).png
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
will this work for you?


=if(isblank(K8),"",COUNTIF(G:G, K8))
 
Upvote 0
That should be
Excel Formula:
=IF(K8="","",COUNTIF(G:G,K8))
ISBLANK doesn't work with formula blanks, only empty cells.
 
Upvote 0
Solution
will this work for you?


=if(isblank(K8),"",COUNTIF(G:G, K8))
Thanks for the reply but, as Jason said, same issue persists with this. I perhaps should have made it clearer that the cells in K are not empty but contain the SELECT formula.
 
Upvote 0
That should be
Excel Formula:
=IF(K8="","",COUNTIF(G:G,K8))
ISBLANK doesn't work with formula blanks, only empty cells.
Thank you for this - in my earlier reply I somehow didn't notice the top half of your response, but this worked perfectly. Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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