COUNTIFS up to a certain number of occurences

danthesuperman

New Member
Joined
May 25, 2020
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
I am using a COUNTIFS forumla to count the number of times a row matches two criterea. This is to act as a kind of dynamic counter for a scholarship ranking sheet to show how many scholarship are allocated to students in each department as we move the ranking around. However I only have 7 of a certain type of scholarship to awarded. Student's eligibility for this scholarship is indicated by the first criteria.

I want the forumla to count only the first seven occurrences of the first criteria.

Currently my forumla looks like this:

=COUNTIFS('Schol List'!$F$28:$F$61,"*YES*",'Schol List'!$C$28:$C$61,"*Department A*")

This formula is then repeated for each department (see image).

What do I need to add so that I only count the first seven occurences of 'Schol List'!$F$28:$F$61,"*YES*" regardless of department?
 

Attachments

  • Capture.PNG
    Capture.PNG
    3.7 KB · Views: 13

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Ctrl shift enter fort the array formula, not just Enter.
Awesome!

Now I am just having issues transposing this over to my actual sheet where I use an index to find the department eg CI_XXXXX and thus use "*CI&" and the data is on a seperate tab.

I'm currently looking like this:
=(COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C$28:$C$61,SMALL('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7),"*CI*",'Faculty Merge List'!$F$2:INDEX('Faculty Merge List'!$F$28:$F$61,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes"))

But it just comes up like this:
1590466309607.png
 
Upvote 0
=COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7),"*CI*",'Faculty Merge List'!$F$2:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes")


Remember Ctrl shift enter
 
Upvote 0
=COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7),"*CI*",'Faculty Merge List'!$F$2:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes")


Remember Ctrl shift enter

Still getting the #NUM! error :(.
1590468069868.png
 
Upvote 0
You lost the IF after SMALL, please refer to my original formula. i am using phone, so you may modify the formula by yourself.
Still getting a VALUE error after using this:

=COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"*CI*",'Faculty Merge List'!$F$2:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes")
 
Upvote 0
Still getting a VALUE error after using this:

=COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"*CI*",'Faculty Merge List'!$F$2:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes")
please upload a screenshot of current error.
 
Upvote 0
after check the formula again and again.....change F2 to F28;)

=COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"*CI*",'Faculty Merge List'!$F$28:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes")
 
Upvote 0
after check the formula again and again.....change F2 to F28;)

=COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"*CI*",'Faculty Merge List'!$F$28:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes")

Amazing Amazing Amazing!

It works fine!

Also easily transposes for into my Google Sheet as this:

=ArrayFormula(COUNTIFS('Faculty Merge List'!$C$28:INDEX('Faculty Merge List'!$C:$C,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"*CH*",'Faculty Merge List'!$F$28:INDEX('Faculty Merge List'!$F:$F,SMALL(IF('Faculty Merge List'!$F$28:$F$61="Yes",ROW('Faculty Merge List'!$F$28:$F$61)),7)),"Yes"))

Thanks!!!!!!
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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