+ Reply to Thread
Results 1 to 5 of 5

Criteria Based Counting

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    3

    Criteria Based Counting

    Hi All,

    I am attempting to count the total number of times certain criteria appear over multiple columns in a large data set.

    Column A - Criteria Range
    Column B - 1, 2, 3 or blank
    Column C - 1, 2, 3 or blank
    Column D - Numeric Value +ve/-ve or blank

    Condition;

    Criteria Range matches criteria & value of C<=B and D >30

    Formula;

    COUNTIFS('SheetRef'!$A:$A,$CriteriaCell,'SheetRef'!$C:$C,"<="'SheetRef'!$B:$B,'SheetRef'!$A:$A,$CriteriaCell,'SheetRef'!$D:$D,">30")

    I have successfully used a similar formula when the criteria is a specific value, but I cant get it to work when the criteria is another corresponding value in another column. Any help on this would be much appreciated.
    Last edited by Dominiks; 11-30-2017 at 08:30 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Criteria Based Counting

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Criteria Based Counting

    Try this ...

    SUMPRODUCT(('SheetRef'!$A1:$A1000=$CriteriaCell)*('SheetRef'!$C1:$C1000<='SheetRef'!$B1:$B1000)*('SheetRef'!$D:$D>30)

  4. #4
    Registered User
    Join Date
    10-11-2012
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    3

    Re: Criteria Based Counting

    Many thanks Phuocam I managed to get this working!

    I had to add in an additional condition to not count blanks as the formula would include them if the referenced cells had formulas in them. Cant work out why it does that but when I tried it in a simplified sheet without formula in them it worked so can only think that is what caused it. As soon as that was added in it works a treat and I greatly appreciate the help.

    Kind Regards

    Dominik

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Criteria Based Counting

    Quote Originally Posted by Dominiks View Post
    Cant work out why it does that ......
    Excel considers any text value to be greater than any number.....and a “formula blank” returned by a formula is also a text value
    Audere est facere

+ 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] Counting based on criteria
    By D_N_L in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2012, 07:03 AM
  2. Counting Based on Set Criteria
    By SlyEnemy in forum Excel General
    Replies: 3
    Last Post: 09-13-2011, 06:13 AM
  3. Counting based on 2 criteria
    By reynastus in forum Excel General
    Replies: 1
    Last Post: 08-05-2010, 03:54 AM
  4. Counting rows based on different criteria
    By pethaa1791 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-28-2008, 06:02 PM
  5. Counting Based on 2 criteria?
    By CParnell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2007, 12:13 AM
  6. Counting based on multiple criteria
    By cubsfan in forum Excel General
    Replies: 1
    Last Post: 04-21-2006, 10:58 AM
  7. [SOLVED] counting occurences based on two criteria
    By nackington in forum Excel General
    Replies: 6
    Last Post: 04-20-2006, 08:30 AM
  8. counting based on criteria
    By SOT in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-09-2005, 02:06 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