Count(if(if(..))) not working

bluesky6688

New Member
Joined
Dec 24, 2013
Messages
34
I wanted to count the values that matches some criteria. I used the "Count(if(if()))" before and it worked perfectly. These formulae still work in their original cells. Today I tried to make similar ones but they wouldn't work. See example below:

ABCDEFG
1IDgroupageDistm1m2m3
2C1AA650112131
3C1AA6100122232
4C1AA6150132333
5C1AA6200142434
6C2BB850152535
7C2BB81001626
8C2BB81501737
9C2BB82002838
10C2BB82501929
11C2BB8300203040
12C2BB84003141
18C2BB7777

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

D18 - G18 = COUNT(IF($A$2:$A$17=$A$20,IF($B$2:$B$17=$B$20,G2:G17)))

E18 and F18 should return 6 and G18 should return 5

I tried "Countifs" function but it wouldn't work either:

=countifs($A$2:$A$17,$A$20,$B$2:$B$17,$B$20,G2:G17,<>"")

Thanks for any help and have a great weekend!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
=countifs($A$2:$A$17, $A$20, $B$2:$B$17, $B$20, $G$2:$G$17, "<>")
 
Last edited:
Upvote 0
=countifs($A$2:$A$17, $A$20, $B$2:$B$17, $B$20, $G$2:$G$17, "<>")

This works. Thank you, shg!

I also made the count(if(if(...))) work by adding another criteria if(G2:G17<>"". I like this formula because I can use it to calculate averages and stdev with just changing one word.

What's the difference between "<>" and <>""? Do they both seem to mean nonspace but just used in different situations?
 
Upvote 0
What's the difference between "<>" and <>""?
The first is a string that gets evaluated by the function. The second is an invalid expression.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

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