+ Reply to Thread
Results 1 to 8 of 8

How to count one range using multiple criteria

  1. #1
    Registered User
    Join Date
    07-16-2015
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    3

    How to count one range using multiple criteria

    I'm trying to compare two different credit rating systems. One rates stocks Aaa, Aa1, Aa2, Aa3, A1....and so on. The other rates things IG1, IG2.... I have the stocks in column A the first ratings in column B and the second rating in column C. I want to count how many stocks are listed as Baa3 or HIGHER in column B but LOWER than IG10 in column C. Is there a way to do this?

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How to count one range using multiple criteria

    Would something like this work for you?

    EDIT: What I've done is
    1) Created a list of credit ratings based on ranking (one for Moody's and the other for IG)
    2) Compare them using MATCH functions.
    Attached Files Attached Files
    Last edited by quekbc; 07-16-2015 at 10:36 PM.

  3. #3
    Registered User
    Join Date
    07-16-2015
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    3

    Re: How to count one range using multiple criteria

    Wow that's great thanks!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to count one range using multiple criteria

    quekbc, we are trying to encourage members to include their suggested formula/s in their post, so other members don't need to upload your file, just to see what you did
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How to count one range using multiple criteria

    Fairly noted, Ford. It would have been a fairly long process to write everything down and I thought it would be best shown in a spreadsheet + I was feeling lazy earlier today - need more coffee.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to count one range using multiple criteria

    I was feeling lazy earlier today - need more coffee.
    haha been there done that. Just saying that if it is a short-ish formula, add it to your post, along with the file. Wont always be practical, but it often helps

  7. #7
    Registered User
    Join Date
    07-16-2015
    Location
    Arizona
    MS-Off Ver
    2010
    Posts
    3

    Re: How to count one range using multiple criteria

    Just curious, What is the "--" for in the formula?

  8. #8
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How to count one range using multiple criteria

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

    This is to deal with the TRUE/FALSE values within the first parenthesis of the --, that is... the formula MATCH(B1:B5,$K$2:$K$24,0)<MATCH(G2,$K$2:$K$24,0) results in an array of TRUEs and FALSEs, (e.g. {FALSE, FALSE, TRUE, TRUE, FALSE})
    The first negative sign (-) converts the TRUEs and FALSEs to -1s and 0s. (i.e. {0, 0, -1, -1, 0}). The second "-" converts it back to positive (i.e. {0, 0, 1, 1, 0}) so I can use it with a SUMPRODUCT to only SUM the numbers that I want.

    You'll see variants of these here. I use --, some use 0+, some use 1*. All these does pretty much the same thing, converting TRUEs and FALSEs to 1s and 0s.
    Last edited by quekbc; 07-17-2015 at 05:04 PM.

+ 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] Count Multiple Criteria in a single Range on a Different Sheet
    By stefanpg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2012, 04:29 PM
  2. Replies: 6
    Last Post: 11-11-2012, 12:40 AM
  3. Count - multiple criteria, multiple sheets, and date range.
    By threecliffs in forum Excel General
    Replies: 6
    Last Post: 06-14-2011, 01:36 PM
  4. Replies: 4
    Last Post: 04-08-2011, 05:24 PM
  5. Replies: 15
    Last Post: 02-24-2011, 01:23 AM
  6. Count within range with multiple criteria
    By JuJuBe in forum Excel General
    Replies: 3
    Last Post: 07-20-2010, 12:01 PM
  7. Count multiple values in cell with range criteria
    By leanne13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-06-2009, 02:26 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