# Count Only Positive Numbers With Another Condition

#### Firas

##### New Member
Assuming 2 columns of 100 rows each; the first contains the names John, Mary, Joe in random order. The second contains positive, zeros and negative numbers. What would be the formula to COUNT all of the positive numbers in column B that are associated with the name John in column A?
Firas
<!-- / message -->

### Excel Facts

Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Welcome to the MrExcel board!

Try
=SUMPRODUCT(--(A1:A100="John"),--(B1:B100>0))

Assuming 2 columns of 100 rows each; the first contains the names John, Mary, Joe in random order. The second contains positive, zeros and negative numbers. What would be the formula to COUNT all of the positive numbers in column B that are associated with the name John in column A?
Firas
<!-- / message -->
Code:
``````=SUMPRODUCT(
--(\$A\$2:\$A\$100=E2),
--ISNUMBER(\$B\$2:\$B\$100),
--(\$B\$2:\$B\$10 > 0))``````

where E2 houses a value like John.

Thank you both. The sum product will give add the values, but I need just to count them.

Thank you both. The sum product will give add the values, but I need just to count them.
Did you try the formula?

My bad. I just did and it worked. Thanks very much

Replies
3
Views
270
Replies
1
Views
307
Replies
7
Views
183
Replies
11
Views
324
Replies
6
Views
478

1,196,155
Messages
6,013,764
Members
441,781
Latest member
Gian Carlos

### 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.

### Which adblocker are you using?

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

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