countifs formula needed

uswyne

Board Regular
Joined
Jul 27, 2017
Messages
78
Office Version
  1. 2019
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
[TABLE="width: 500"]
<tbody>[TR]
[TD]Reg No[/TD]
[TD]Class[/TD]
[TD]PG[/TD]
[TD]Nur[/TD]
[TD]KG[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]PG[/TD]
[TD]required answer is 3 instead of 4[/TD]
[TD]Same[/TD]
[TD]Same[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]PG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]Nur[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]29[/TD]
[TD]KG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]PG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]PG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Nur[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]35[/TD]
[TD]Nur[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
[TABLE="class: grid, width: 201"]
<tbody>[TR]
[TD]Reg No[/TD]
[TD]Class[/TD]
[TD]PG[/TD]
[TD]Nur[/TD]
[TD]KG[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD]PG[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD]PG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]27[/TD]
[TD]Nur[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]29[/TD]
[TD]KG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]30[/TD]
[TD]PG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]PG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Nur[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]35[/TD]
[TD]Nur[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

In C2 control+shift+enter, not just enter, and copy across:

=SUM(IF(FREQUENCY(IF($B$2:$B$9=C$1,IF(ISNUMBER($A$2:$A$9),$A$2:$A$9)),$A$2:$A$9),1))

Is this what you are after?
 
Upvote 0
You could also have added in response to post #2 that it's not what you are after. Curious though: If 30 in the record < 30, PG > would have been 25, would the result for PG still be 3?
 
Upvote 0
This is reg no, it could be any number. If student registered in my branch than the registration number will be generated otherwise student would be Transferred In from another branch and registration number field would be blank.

However, i tried this but answer shown in C1 is 6.

You could also have added in response to post #2 that it's not what you are after. Curious though: If 30 in the record < 30, PG > would have been 25, would the result for PG still be 3?
 
Upvote 0
This is reg no, it could be any number. If student registered in my branch than the registration number will be generated otherwise student would be Transferred In from another branch and registration number field would be blank.

However, i tried this but answer shown in C1 is 6.

You didn't say what the value should be... By the way, the formula I suggested should return a different value, not 6.

For the record, the formula I suggested requires control+shift+enter, not just enter. That means: Press down the control and the shift keys at the same time, while you hit the enter kay. If done correctly, Excel itself puts a pair of { and } around the formula in recognition.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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