Countif formula

Makat

New Member
Joined
Mar 22, 2006
Messages
49
Hello,
I have a range of cells containing numbers 1-4 or some may have the letters "na". I am using a formula to count all the cells that contain a number and then multiply that number by another cell. Formula is:
=(COUNTIF(I5:CA5,">=0")-COUNTIF(I5:CA5,">=5"))*H5.
I have been asked not to include cell AC5 in that count and I don't know how to modify the formula to exclude that one cell.
I appreciate any help!!!! Thanks,
Makat
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Dan Waterloo

Well-known Member
Joined
Jan 4, 2007
Messages
876
Try

=((COUNTIF(I5:CA5,">=0")
- countif(AC5, ">=0")
- COUNTIF(I5:CA5,">=5")
+ countif(AC5, ">=5")) * H5
 

Makat

New Member
Joined
Mar 22, 2006
Messages
49
That looks like it will work!
How would I use the same concept to exclude cell AC5 if I were adding up all the numbers in a range and then dividing that number by another cell?
The current formula is: =SUM(I5:DO5)/DR5
 

Dan Waterloo

Well-known Member
Joined
Jan 4, 2007
Messages
876
Or another way:
=(SUM(I5:AB5) + SUM(AD5:DO5))/DR5
 

Forum statistics

Threads
1,181,606
Messages
5,930,869
Members
436,764
Latest member
avalladarez

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
Top