+ Reply to Thread
Results 1 to 7 of 7

Referencing criteria listed in column with COUNTIFS function

  1. #1
    Registered User
    Join Date
    12-09-2013
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Referencing criteria listed in column with COUNTIFS function

    Hello,

    Instead of one of my countifs criteria listing the long list of decision codes highlighted below in red, how can I reference that criteria that is in { } if it is listed in a table based on its different classification, that is the label assigned to that the specified group of codes. Thanks for the help

    =SUM(COUNTIFS(Table[Correct Type],$A5,TargetX[Latest Decision],{"CO","CC","DA","DD","DF","DP","DW","IE","NS","PR","PW","RJ","RW","SD","SM","WA","WD","WI","WL","WN","WO","WP","WS"},Table[Date],"<="&$A$1))

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Re: Referencing criteria listed in column with COUNTIFS function

    Try naming the range containing the list then reference the range name in your formula.

    If this doesn't help please attach a copy of your workbook so we can test solutions on your own data. Remember to remove/replace any sensitive data before uploading.
    Trish in Oz
    -------------
    A problem well defined is a puzzle half solved


    If you attach a sample of your workbook it will be easier to find a solution. Remember to remove/replace sensitive data before uploading the file. Look here if you need help with attachments:
    http://www.excelforum.com/faq.php?fa...b3_attachments

  3. #3
    Registered User
    Join Date
    12-09-2013
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Referencing criteria listed in column with COUNTIFS function

    Here is an example file of what I am trying to do. Essentially the range of text criteria I would want to name or reference reflects "or" logic so to speak, that is all records that contain any one of the text codes within that referenced range of criteria gets counted. Thanks for the help!



    CountIFs_range_critera.xlsx

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Referencing criteria listed in column with COUNTIFS function

    Try this array formula** entered in B4:

    =SUM(COUNTIFS(Records[Date],"<="&$C$1,Records[Gender],$A4,Records[Code],INDEX(Criteria[#All],0,MATCH(B$3,Criteria[#Headers],0))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to D4 then down to B5:D5
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Referencing criteria listed in column with COUNTIFS function

    Try this in B4

    =SUMPRODUCT(COUNTIFS(Records[Date],"<="&$C$1,Records[Gender],A4,Records[Code],Codes[Completed]))

    Change Completed to Reviewed and Accepted for C4 and D4

  6. #6
    Registered User
    Join Date
    12-09-2013
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Referencing criteria listed in column with COUNTIFS function

    ^ Easiest fix. Should have thought to try with sumproduct myself. Thanks

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Referencing criteria listed in column with COUNTIFS function

    You're welcome.

+ 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] COUNTIFS using multiple criteria - maybe an OR function?
    By Calder in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2014, 12:10 PM
  2. COUNTIFS - Referencing a Table with Multiple Criteria/Conditions
    By MediaTrap in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2013, 03:58 AM
  3. [SOLVED] Countifs function with multiple criteria in same column
    By sam99 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2012, 09:10 AM
  4. Criteria values in COUNTIFS function
    By jsnoz in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-21-2011, 12:46 PM
  5. Replies: 2
    Last Post: 11-12-2009, 10:31 PM

Tags for this Thread

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