+ Reply to Thread
Results 1 to 5 of 5

Help with COUNTIFS

  1. #1
    Registered User
    Join Date
    01-23-2012
    Location
    Essex
    MS-Off Ver
    Excel 2010
    Posts
    21

    Help with COUNTIFS

    Hello all, I have a spreadsheet that logs applicants for the sixth form i work for. Column D has the school ppils currently attend. Column F has what preference we are for the pupil (i.e. 1st choice, undecided). Columns G to M have the subjects that have selected in each available block (i.e. maths in block A, nothing in block b, science in block c)

    I created a simple formula for counting the pupils that applied whether we are 1st choice based on where they applied to us from =COUNTIFS(Applicants!$D:$D,"SCHOOLNAME",Applicants!$F:$F,"1st Choice") - which works fine.

    I'm now trying to create the same thing but counting each subject name. But no matter how i do the countifs formula i am receiving a #value error. Example: =COUNTIFS(Applicants!$G:$M,"Science",Applicants!$F:$F,"1st Choice")
    As far as i can tell its the column range G:M that is causing it to fail, but ideally i need that as the subjects offered in each block can change regularly, so i need a formula that can handle those changes automatically.

    Would i need to do each argument for each column and do additional +countifs? Would be a very large formula if so.

    I'm not the best using excel so certain I'm missing something really obvious, or may need a different formula. Any help anyone can provide would be greatly appreciated!

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Help with COUNTIFS

    Yes, as you note, the fact your dimensions are of unequal size means COUNTIFS won't work, you can revert to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    however, I would strongly advise you refine your ranges from entire columns to relevant rows, either c/o a dynamic named range or, if you know your dataset won't be bigger than "x" rows where x is relatively small (i.e. few k) use x

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by XLent; 02-13-2019 at 12:04 PM. Reason: typo in sheet name

  3. #3
    Registered User
    Join Date
    01-23-2012
    Location
    Essex
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Help with COUNTIFS

    Thanks so much XLent, that's incredibly helpful. I did try SUMPRODUCT but kept getting an error that explained it couldn't calculate due to maxing out resources so it's really helpful to know why. Thank you so much!

  4. #4
    Registered User
    Join Date
    01-23-2012
    Location
    Essex
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Help with COUNTIFS

    Another quick question if you don't mind?

    Say the pupil preference in column F changes from 1st Choice to Withdrawn, and I need to show the total numbers minus those who have withdrawn from each subject, can that sumproduct formula you created be manipulated to show that also? Thanks

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help with COUNTIFS

    For these sorts of exercises you'd be better creating a normalised table of data so that you can more easily analyse your data.

    You are mixing up the two elements of data capture and final reporting. The two require quite different treatments.

    A lot of people start by designing the form that they expect to see as the final report or which at first glance seems the best way of capturing data, and then wonder why it's so difficult to subsequently analyse and summarise or extract information from it. Yours exhibits all those features.


    You should always capture data in a simple two dimensional table and worry about reporting information from it afterwards. Without exception doing this you will always be able to easily obtain management information. Rarely is this the case if you start the other way round.
    You will also throw open the whole wonderful world of the powerful Pivot table functionality.

    So before you get too far with this I'd create a single sheet database that contains columns for

    Pupil Name
    School
    Preference *
    Block *
    Subject *


    The * values could be Validation drop down cells from which you could pick values. The way I normally arrange these things is to have a single data entry row above the database in which the new values are entered, then a button which runs a macro that adds the new record to the database.

    If there's a one to one mapping between Pupil and School then the School could be a VLOOKUP formula to a separate table of Pupil & School
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sumproduct to replace countifs as countifs don't work on external source reference
    By KrishnaSagar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2017, 02:33 AM
  2. How can I run CountIfs + CountIfs without double counting?
    By hiitsjessie in forum Excel General
    Replies: 1
    Last Post: 02-06-2017, 04:49 PM
  3. [SOLVED] Countifs + Countifs - replacement?
    By JulieQ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-05-2015, 03:02 PM
  4. COUNTIFS OR COUNTIFS needs to work
    By joshbellfi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2013, 10:55 AM
  5. [SOLVED] Need help with COUNTIFS
    By rival2031 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2013, 07:55 PM
  6. COUNTIFS OR...multiple countifs without duplication in the numbers
    By HooligaD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 09:53 AM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1