Countif ignore empty cells.....

albertc30

Well-known Member
Joined
May 7, 2012
Messages
1,091
Office Version
  1. 2019
Platform
  1. Windows
Morning to all.

Sometimes I just come to a brick whall and, instead of stopping, I just smash my head open, get my self in a right state which in most cases leads to a mild headake.

I have the following formula;
=SUM(H54:T54)/COUNTIF(H54:T54,"<>0")

Cell H = "=H49-(H44+H45)"
Cell I = 0, no formula is here, cell is empty

The above repeats throughout cell U54.

Cell J54 = "-64" as a result of the formula in place.

Why is it that my formula gives me a -9? I can see it's taking the formulas on the cells as <>0.

How do I circuvent this issue please?

Many thanks in advance.


P.S. I have sorted. I have used a combination of count with - countif. SORRY EVERYONE.
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
What are you trying - exclude zero values while averaging? If so:

=AVERAGEIF(H54:T54,">0")

=IFERROR(AVERAGEIF(H54:T54,">0"),"")
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

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