How do I add an exclude counting zero to an existing formula?

JimmyW74

New Member
Joined
Feb 28, 2023
Messages
3
Office Version
  1. 2021
Platform
  1. MacOS
Firstly, I must say I am a real novice at all of this!

I have the following formula: = COUNTIF( G5:G29, ">79")/COUNTA( G5:G29 )*100

It counts how many results from students are 79 and below and then gives me an overall group percentage. Occaisionally we have absentees and so a 0 is recorded- I don't want the zero to be counted but can't figure out how to put this into the formula. Everything I try doesn't work.

Can anyone help me?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Excel Formula:
=COUNTIF(G5:G29,">79")/(COUNTA(G5:G29)-COUNTIF(G5:G29,0))*100
 
Upvote 0
Welcome to the MrExcel board!

What about just ..
Excel Formula:
=COUNTIF(G5:G29,">79")/COUNTIF(G5:G29,">0")*100
 
Upvote 0
Welcome to the MrExcel board!

What about just ..
Excel Formula:
=COUNTIF(G5:G29,">79")/COUNTIF(G5:G29,">0")*100
Thanks...a further question. That formula works fine for that column of the sheet. But if I apply it it to another column and change the range to from G5:G29 to K5 to K29, I get this error message: Function DIVIDE parameter 2 cannot be zero.

How can fix this?
 
Upvote 0
I get this error message: Function DIVIDE parameter 2 cannot be zero.
That message does not look familiar to me. Are you using Excel, Google sheets or something else?
 
Upvote 0
The error might be occurring in Google sheets when the second parameter of the DIVIDE function (the denominator) is zero or blank. This means that either the COUNTIF(G5:G29,“>0”) or the COUNTIF(K5:K29,“>0”) returns zero in your formula. You can check this by entering these functions separately in different cells and see what values they return. The second value (the value after the division symbol “/”) cannot be zero, since dividing by zero is infinite or undefined mathematically.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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