Count and Ignore Zero or Blanks

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have the following table:

Excel Workbook
BCDEFGHIJKLMNOP
3MonTueWedThuFriSatSunMonTueWedThuFriSatSun
4Staff Name01-01-1802-01-1803-01-1804-01-1805-01-1806-01-1807-01-1808-01-1809-01-1810-01-1811-01-1812-01-1813-01-1814-01-18
5John3333333333
6Amanda3333333333
7Julie33333
8Ally3333333333
9Total912991201291212900
Sheet1


I need to calculate the number of times the rows highlighted in yellow is less than 12 but to ignore cells which are blank or zero. I tried using the the formula below but it does not seems to work. Appreciate any assistance. The correct answer should be 5.

=COUNTIFS(C9:P9," <12")-COUNTBLANK(C9:P9)-COUNTIF(C9:P9,0)
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try using

Code:
=COUNTIFS(C9:P9,">0", C9:P9,"<12")
 
Upvote 0
Hi Michael,

Thank you. That worked. Appreciate your time and patience. You have a good day ahead.
 
Upvote 0
Hi ,

The range is in sheet 1 and the criteria(s) are in sheet 2. I just realized countifs does not work. Is there another way ? I tried the following formula but does not seems to work. Appreciate all help.

Code:
=SUMPRODUCT(('YTD LEAVE VIEW'!G20:AK20)>0*('YTD LEAVE VIEW'!G20:AK20)<'SUMMARY 2'!C7)
 
Last edited:
Upvote 0
which one is sheet 1 ?
Where is the formula going to reside, sheet1 or 2 ??
 
Upvote 0

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

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