=sum(countif... array formula but only for non empty cells

joshman108

Active Member
Joined
Jul 6, 2016
Messages
310
Functionally, this is working and doing what I need:
={SUM(COUNTIF(B:AO,B1:AO1))}

It's just really slow because I have 9000 rows and this is being dragged down. It would probably take hours to calculate. I'm assuming it's slow because it's taking empty cells into account as in general, only about 1/3 of all cells b1:ao1 (and on all other rows) actually have values. The rest are blank. What's the fastest way of accomplishing my formula without the major calculation time - which I'm assuming is because it's searching blank cells which I don't actually need to be searching, since they're blank?

I tried something like this:

=SUM(COUNTIF(B:AO,IF(B1:AO1="","",B1:AO1)))

but that doesn't work :p
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You could try:

=SUM(IF(B1:AO1="",0,COUNTIF(B:AO,B1:AO1)))
with Control+Shift+Enter,

but I don't know how much that will help.
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,893
Members
449,194
Latest member
JayEggleton

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