+ Reply to Thread
Results 1 to 16 of 16

Counting data with multiple criteria from different columns

  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Counting data with multiple criteria from different columns

    Dear All,

    This is my first post. I have been having trouble with Excel and I am hoping to get some help.

    I am trying to count data using multiple criteria in different columns. I.e. counting values in one column that are between 500 and 1000 and in another column - either “fixed deposits” or call deposits.

    The results of the formula below are the count for the values within the range (500 to 1000) that are “Fixed deposits” but the call deposits are not being counted.

    I know there is a simple of way doing this, but I can’t figure it out. Please help.
    =+COUNTIFS(I2:I11,"<="&1000,' Clients'!I2:I11,">="&500,$F$2:$F$11,{"FIXED DEPOSITS","CALL DEPOSITS"})

    Your assistance is much appreciated

    Kindest Regards
    Muammar
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Sorry the formula I am actually using

    =COUNTIFS($B$2:$B$11,"<="&Parameters!$B$1,Data!$B$2:$B$11,">="&Parameters!$B$2,A2:A11,{"FIXED DEPOSITS","CALL DEPOSITS"})

    and the correct file is attached to this message.
    Attached Files Attached Files

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Counting data with multiple criteria from different columns

    your function is returning an array so all you gotta do is sum it
    =SUM(COUNTIFS($B$2:$B$11,"<="&Parameters!$B$1,Data!$B$2:$B$11,">="&Parameters!$B$2,A2:A11,{"FIXED DEPOSITS","CALL DEPOSITS"}))
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Thanks JP. Simple solution but its going to take me a long way. Appreciate it.

  5. #5
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Is it possible to extend this formula to a third column, (i.e. third criteria)?

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Counting data with multiple criteria from different columns

    yes if you mean one more column with one criterion

  7. #7
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Thanks again. So I assume one more column with more than one criterion will not be possible?

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Counting data with multiple criteria from different columns

    you can do it but your second array needs to be row-wise (use ; instead of , in the array constant)

  9. #9
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    You’re right, that worked. I know I am pushing it but is it possible to add more than one criterion from a fourth column?

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Counting data with multiple criteria from different columns

    I'd recommend you use SUMPRODUCT for that since it allows you to use syntax like
    =SUMPRODUCT(($B$2:$B$11<=Parameters!$B$1)*(Data!$B$2:$B$11>=Parameters!$B$2)*(ISNUMBER(MATCH(A2:A11,{"FIXED DEPOSITS","CALL DEPOSITS"},0))))
    and you can repeat the last part for different criteria on different columns.

  11. #11
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Cheers. About to leave the office. Will definitely try that tomorrow and get back to you.

  12. #12
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Hi Joseph,

    I used the formula suggested for counting the data in numerous columns with numerous criterion and added one column to the same formula as below.

    =SUMPRODUCT((ABS($B$2:$B$38)<=Parameters!$B$1)*(ABS($B$2:$B$38)>=Parameters!$B$2)*(ISNUMBER(MATCH($A$2:$A$38,{"FIXED DEPOSITS","CALL DEPOSITS"},0)*(ISNUMBER(MATCH($C$2:$C$38,{"CORPORATE","PUBLIC SECTOR"},0))))))

    I am getting a result of 6 instead of 5. I assume it’s the wrong use of the formula. Please advice?

    I have attached my workbook to assist.

    Kindest Regards
    Muammar
    Attached Files Attached Files

  13. #13
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Counting data with multiple criteria from different columns

    your first ISNUMBER function was not being closed in the correct place
    =SUMPRODUCT((ABS($B$2:$B$38)<=Parameters!$B$1)*(ABS($B$2:$B$38)>=Parameters!$B$2)*(ISNUMBER(MATCH($A$2:$A$38,{"FIXED DEPOSITS","CALL DEPOSITS"},0))*(ISNUMBER(MATCH($C$2:$C$38,{"CORPORATE","PUBLIC SECTOR"},0)))))

  14. #14
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Thanks again.

    On another topic…. Assuming I have formulas that pick a set of data from the first to the last row and I want to add a new set of data, is it possible to make sure all the formulas I am applying to the original set pick the new data, i.e. as opposed to changing them manually?

  15. #15
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Counting data with multiple criteria from different columns

    that's a totally different question and should be posted as one I think. it sounds like you want dynamic named ranges or to use tables.

  16. #16
    Registered User
    Join Date
    09-06-2012
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Counting data with multiple criteria from different columns

    Okay. I shall do that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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