Help needed on COUNTIF function

rajtak

Board Regular
Joined
Feb 23, 2009
Messages
74
Hi,

I want to count the number of diseases for each year and input the result to the table highlighted below.

In 1996 has 4 counts of cancer which i want to input under the header Cancer for row 1996. Similarly 1991 has 1 count of dermatologic which i want to input under the header Dermatologic and so on for others as shown below.

I want this to be achieved using COUNTIF or any other function but not VBA script or Pivot Table.

Thank you in advance

mrexcel3.jpg
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

Do you mean like this:

=COUNTIF(A1:A1000,B1)

Where A1 is your range, and B1 is the header "Cancer".
 
Upvote 0
I think was not clear in my question.

I want to count the diseases for each year from Column A and B.

Suppose Cancer is listed 4 times for 1996 and 2 times for 1997

I need that count in another table underneath the header 'Cancer' (As shown on image above) so 4 should be shown for 1996 and 2 should be shown for 1997
 
Upvote 0
Basically i need a count of diseases listed according to year

1996 - Cancer
1996 - Renal
1996 - Cancer
1997 - Viral
1997 - Cancer
1997 - Viral

As per the above example
1996 has 2 Cancer, 1 Renal
1997 has 1 Cancer, 2 Viral
 
Upvote 0
Try

=sumproduct(--($A$2:$A$17=$C2),--($B$2:$B$17=D$1))
 
Upvote 0

Forum statistics

Threads
1,224,570
Messages
6,179,610
Members
452,931
Latest member
The Monk

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