+ Reply to Thread
Results 1 to 7 of 7

Range of values meeting a range of criteria

  1. #1
    Registered User
    Join Date
    04-01-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2016
    Posts
    18

    Range of values meeting a range of criteria

    Hi guys,

    This is a bit of a complex one that's had me scratching my head for a while, as I'm not all too familiar with this side of excel.

    4b8b64822b.png

    As you can see, I've got 3 tables here. Firstly, a list of names and corresponding codes (any name could have any code). There can be multiple of the same name and same code in this table.
    On the far right, we have a table of 3 categories of names.
    Then in the middle, I've got a table that I want to show the final result. I'd ideally like for it to record every time anyone in a particular category corresponds to one of the codes.

    For example, cell F2 would show the amount of times either Mary, Dale or Albert corresponded with a code 1 in the left hand table. Cell K3 would show the amount of times James, Alfred or Lisa corresponded with a code 6 in the left hand table.

    Bear in mind, I may be working with much larger, and changing sets of data, so the formula will probably need to work when copied across the rest of the table, and couldn't just contain ("Mary","Dale","Albert"), for example.

    Help is greatly appreciated!

    Alex
    Attached Files Attached Files

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Range of values meeting a range of criteria

    Try

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




    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy across .
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Registered User
    Join Date
    04-01-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: Range of values meeting a range of criteria

    Quote Originally Posted by shukla.ankur281190 View Post
    Try

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




    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy across .
    Fantastic! That seems to have worked perfectly, thanks so much!

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Range of values meeting a range of criteria

    Happy to help and thank you for feedback and reputation

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  5. #5
    Registered User
    Join Date
    04-01-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: Range of values meeting a range of criteria

    Quote Originally Posted by shukla.ankur281190 View Post
    Happy to help and thank you for feedback and reputation

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Hi mate,

    I've just come across a problem when doing some more tweaking. Firstly, when using larger and variable ranges, the formula (seemingly randomly) will match blank areas in the right hand column with blank areas in the left hand column (in the actual version of this that I'm working on, the left hand column tends to have some blanks). This, will hence add these to the total, which I do not want.

    Secondly, I've noticed that the formula actually does not account for if a certain combination happens more than once, for example, if i had William and 10 occur twice or more in the left column, it would only count that particular occurrence once.

    Do you have any work around for 1 or these two? I may have found a relatively dirty way of solving the first problem, but the second problem is a bit more pressing for me.

    Much appreciated,

    Alex

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Range of values meeting a range of criteria

    Secondly, I've noticed that the formula actually does not account for if a certain combination happens more than once, for example, if i had William and 10 occur twice or more in the left column, it would only count that particular occurrence once.
    Try pasting the following modification of shuklaarray entered formula* into cell F2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Activate by pressing Ctrl, Shift and Enter.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Range of values meeting a range of criteria

    Do you have any work around for 1 or these two? I may have found a relatively dirty way of solving the first problem, but the second problem is a bit more pressing for me.
    This does both of those.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 09-03-2017 at 04:33 PM.
    Dave

+ 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] Excel 2007 : Meeting criteria in a range
    By Richmate in forum Excel General
    Replies: 5
    Last Post: 05-17-2012, 05:40 AM
  2. Average of numbers within a range meeting certain criteria
    By opal23k in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-13-2010, 06:06 PM
  3. How do you count a range of cells when meeting criteria
    By seanwash in forum Excel General
    Replies: 2
    Last Post: 04-28-2009, 04:14 PM
  4. [SOLVED] Average of numbers within a range meeting certain criteria
    By opal23k in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. Average of numbers within a range meeting certain criteria
    By Domenic in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-06-2005, 05:05 AM
  6. [SOLVED] Average of numbers within a range meeting certain criteria
    By opal23k in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. Average of numbers within a range meeting certain criteria
    By opal23k in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-25-2005, 05:05 PM
  8. Replies: 0
    Last Post: 08-25-2005, 05:52 AM

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