How to count data in worksheet

ferrie_m

New Member
Joined
Mar 16, 2011
Messages
3
Hi,

I hope someone can help me here asap. :(

Below is my script to count number of names in worksheet.

=COUNTIF('WorksheetA'!I:I,"Critical")

Below is my scritp to count number of dates by range.

=COUNTIF('WorksheetA'!D:D,"<="&DATE(2011,2,1))-COUNTIF('WorksheetA'!D:D,"<"&DATE(2011,1,1))

Now I would like to combine this two formula to filter the date range and critical incidents in the excel sheet. And the Output will be on WorksheetB.


Can someone please assist me how to?

Thanks,
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Welcome to MrExcel.

Try:

=SUMPRODUCT(--(WorksheetA!D1:D1000<=DATE(2011,2,1)),--(WorksheetA!D1:D1000>=DATE(2011,1,1)),--(WorksheetA!I1:I1000="Critical"))

Expand the range references to suit, but make sure that they all have the same number of rows and avoid using entire columns.
 
Upvote 0
In 2007 and above you can do COUNTIFS but you can use sumproduct to do teh same in all versions of excel

So something like


=SUMPRODUCT(--(K17:K19="Critical"),--(L17:L19>=O16),--(L17:L19<017))<O17))< p>
WHere you replace K17:K19 by your range of flags and L17:L19 by your date range

O16 and O17 contain the dates you are interested in
 
Upvote 0
Thanks very much to you both Andrew Poulsom and Energman58. I really appreciate your help. :)

I will try this today. :D

Cheers!
 
Upvote 0
Welcome to MrExcel.

Try:

=SUMPRODUCT(--(WorksheetA!D1:D1000<=DATE(2011,2,1)),--(WorksheetA!D1:D1000>=DATE(2011,1,1)),--(WorksheetA!I1:I1000="Critical"))

Expand the range references to suit, but make sure that they all have the same number of rows and avoid using entire columns.

It works!!! Thanks very much again Andrew. I appreciate your help :D
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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