+ Reply to Thread
Results 1 to 6 of 6

COUNTA formula with criteria

  1. #1
    Registered User
    Join Date
    04-20-2017
    Location
    Christchurch, Dorset
    MS-Off Ver
    2016
    Posts
    29

    COUNTA formula with criteria

    I have a large workbook containing many sheets looking at student progress in a school.
    5 sheets are pasted into the workbook, each containing information for a year group - this is the raw data (Yr 7 Aut 1, Yr 8 Aut 1 etc.).
    The information for our Senior Leaders is contained in sheets Year Groups and Subjects - every other sheets is used to work towards providing that information.

    In an effort to make the workbook more easily used, I've created a DataCells sheet which "declares" which rows and columns data is held - subjects change year on year and I don't want to have to change the formulas at the start of each academic year. I have tried to create lots of validating cross checks to make sure that the data that comes in is all counted in the appropriate places SO......

    On the DataCells sheet I have several COUNTA formulas in row 6 columns E,I,M,Q & U which count all data in the ranges that I want to work on. This is totalled in W6 for a total data count and cross checked on the Counts sheet AT68 which in turn is then checked against the Year Groups Sheet C3 which is finally checked against the Subjects sheet A264!!! Yes - the data needs to be correct to be useful. There are other cross checks built in but they are unimportant to my current problem.

    The Counts sheet works perfectly - it is a simple COUNTIF for each year group.

    The SEN COUNTS, PP COUNTS AND EAL COUNTS sheets are all variations of the original Counts sheet but they are only looking at what we call "vulnerable" students - these are identified on the Raw Data sheets (Yr7 Aut 1 etc.) in:
    Column D for SEN students who have the value of K or E
    Column B or F for PP Students who have a Y in either column and
    Column E for EAL Students who have value of Y
    I have to use COUNTIFS (for the EAL & SEN COUNTS) and SUMPRODUCT (for PP COUNTS). I still need to build the Subjects sheets using only these students but that is a little way off yet.

    Now for the problem.......

    Whilst these additional count sheets all look fine - I want to build the same checking mechanism into the sheets to ensure that I have captured all of the data. So I want to COUNTA the complete range of 'Yr 9 Aut 1'!J2:AT147 for example but only if the EAL column has a Y. And then of course the same for the PP Counts and SEN Counts. I just can't get my head around it - I think an INDEX MATCH with a counta may be the answer but I just can't see how.

    Any help gratefully recieved

    Many thanks

    Sue
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: COUNTA formula with criteria

    hi suebristow, try this in any cell.
    if that's your expectation then you can customize it to be used for your validation.

    =SUMPRODUCT(('Yr 9 Aut 1'!$E$2:$E$147="Y")*('Yr 9 Aut 1'!$J$2:$AT$147<>""))
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  3. #3
    Registered User
    Join Date
    04-20-2017
    Location
    Christchurch, Dorset
    MS-Off Ver
    2016
    Posts
    29

    Re: COUNTA formula with criteria

    Thank you Alvin - that worked perfectly.

    Now I just need the other two counts - SEN and PP which have move criteria. do you have any idea for those please? I've tried :

    =SUMPRODUCT(--('Yr 8 Aut 1'!J2:X142<>""),--(('Yr 8 Aut 1'!F2:F142="Y")+('Yr 8 Aut 1'!B2:B142="Y")>0)) for the PP Count but I get a #VALUE error which appears to be because of the different array dimension.

    Thank you

  4. #4
    Registered User
    Join Date
    04-20-2017
    Location
    Christchurch, Dorset
    MS-Off Ver
    2016
    Posts
    29

    Re: COUNTA formula with criteria

    I've fixed the PP Count using this formula =SUMPRODUCT(--(INDIRECT(E5)<>"")*((INDIRECT(E12)="Y")+(INDIRECT(E8)="Y")>0))

    and the SEN count with this formula =SUMPRODUCT(--(INDIRECT(E5)<>"")*((INDIRECT(E10)="E")+(INDIRECT(E10)="K")>0))

    I've edited the EAL counts to =SUMPRODUCT(((INDIRECT(E11))="Y")*((INDIRECT(E5))<>"")) as well to make use of the INDIRECT stuff - no idea if this is good practice or not but it will hopefully allow me to leave to someone else to keep the data going in every 6 week.

    Thank you so much - I may even understand SUMPRODUCT one day rather than just google it and play until it works!!

    Thank you

    Sue

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: COUNTA formula with criteria

    Sue - have you used the evaluate formula feature to get to the bottom of the SUMPRODUCT function?

    I am one of the few here who will know what SEN and EAL mean!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    04-20-2017
    Location
    Christchurch, Dorset
    MS-Off Ver
    2016
    Posts
    29

    Re: COUNTA formula with criteria

    Never heard of Evaluate Formula - wow, how helpful will that be when working on a complex formula!

    My life at work revolves around providing data that focuses on comparing vulnerable student progress with the rest of the cohort. My guess is maybe you too if you are used to the terminology? 😁

    Thank you

+ 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. Aggregate Counta with criteria
    By cgampon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-28-2016, 10:52 PM
  2. CountA with Multiple Criteria
    By albert28 in forum Excel General
    Replies: 2
    Last Post: 05-25-2014, 11:51 AM
  3. Replies: 3
    Last Post: 06-09-2012, 11:18 PM
  4. Formula to COUNTA distinct values with multiple criteria
    By f0urchette in forum Excel General
    Replies: 4
    Last Post: 02-20-2012, 04:54 AM
  5. countA based on a criteria
    By raza_m33hdy in forum Excel General
    Replies: 2
    Last Post: 03-24-2011, 10:53 AM
  6. sum with counta & countif with many matching criteria
    By Ramzes in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-21-2010, 03:56 AM
  7. countif counta with multiple lookup criteria
    By JR573PUTT in forum Excel General
    Replies: 1
    Last Post: 02-15-2006, 03:37 PM

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