Counif Formula bases on other column reference

harinsh

Active Member
Joined
Feb 7, 2012
Messages
273
I have data similar to below...I would need help in getting coutif formula ...I need count based on names and it should exclude the "Zero" value lines...for each amount type...

I need one count for aaaa & bbbb and rest all other names should come under other names....

NamesAmt1Amt2Amt3
aaaa 1,663 1,092 -
bbbb 1,446 1,642 -
bbbb - 1,652 1,852
dddd 2,560 1,902 1,452
dddd 1,150 1,359 1,537
aaaa 1,111 - 1,518
aaaa - - 1,899
fffff - 1,821 -
fffff 1,350 1,490 1,943

Output should be below
CountAmt1Amt2Amt3
aaaa & bbbb 3 3 3
Other Names 3 4 3

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Maybe

=COUNTIFS($A$2:$A$10,"aaaa",B$2:B$10,">"&0)+COUNTIFS($A$2:$A$10,"bbbb",B$2:B$10,">"&0)
or
=SUM(COUNTIFS($A$2:$A$10,{"aaaa","bbbb"},B$2:B$10,">"&0))


and (B21 is cell with above formula in)
=COUNTIFS(B$2:B$10,">"&0)-B21
 
Last edited:
Upvote 0
Same idea as gaz_chops, but a shorter way to write the first formula:

=SUM(COUNTIFS($A$2:$A$10,{"aaaa","bbbb"},B$2:B$10,">0"))
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

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