Count Days With Certain Criteria...

Russ At Index

Well-known Member
Joined
Sep 23, 2002
Messages
708
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hello Everyone ,

Stumped with this I'm afraid , hoping someone in the Excel World can help me out .

I have the following headers :
MonAm MonPm TueAm TuePm WedAm WedPm ThuAm ThuPm FriAm FriPm SatAm SatPm SunAm SunPm
12 0 0 0 5 5 0 0 6 0 0 0 0 1

I would like a formula that tells me that the total number of full days there was a figure > 0 entered , the example above
would return a answer of : 4

Thank you ,

Russ
 

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
Assuming your data is placed the range A1:N2 ... Try the below formula in cell O2

=COUNTIF(A2:N2,">0")

By the way, shouldn't the answer be 5 & not 4 ?
 
Upvote 0
Just reading your question again, what do you mean by "number of full days" ? Both Am & Pm of the same day ? In the example you provided, only WedAm & WedPm have values above 0 only so how did you calculate the 4 ?
 
Last edited:
Upvote 0
Hi mse330 ,
Thank you for your reply , and you are correct , my mistake the result i am looking for in the example provided is indeed 5.
However , your formula returns an answer of 6 .
To try to make it clearer , Mon has two cells ,am & pm , if both or just one cell has a number >0 count it as 1 , Tue for instance
has two cells am & pm with a figure of zero in each , that does not need to be counted as there was no activity that day.
It would be no problem if there were only one cell er day , but my Boss wants both !!!!

Thanks , enjoy your day ,

Russ.
 
Upvote 0
Hey Russ,

If you want to count any occurance that is above 0 then my first formula supplied will do what we need. However, if you want to count the days that have either AM, PM or both as 1 then the below formula should do that although I am sure other forum members might come up with neater shorter formula ;)


Book1
ABCDEFGHIJKLMNO
1MonAmMonPmTueAmTuePmWedAmWedPmThuAmThuPmFriAmFriPmSatAmSatPmSunAmSunPmAnswer
21200055006000015
31200055006000014
Sheet1
Cell Formulas
RangeFormula
O2=COUNTIF(A2:N2,">0")
O3=IF(SUM(A3:B3)>0,1,0)+IF(SUM(C3:D3)>0,1,0)+IF(SUM(E3:F3)>0,1,0)+IF(SUM(G3:H3)>0,1,0)+IF(SUM(I3:J3)>0,1,0)+IF(SUM(K3:L3)>0,1,0)+IF(SUM(M3:N3)>0,1,0)
 
Upvote 0
Hi mse330 ,

Your second option works perfectly , thank you very much indeed , appreciated.

Regards

Russ
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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