+ Reply to Thread
Results 1 to 6 of 6

Count entries in a range if the ID's match and the value is between a given range

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Pakistan
    MS-Off Ver
    Excel 2016
    Posts
    32

    Count entries in a range if the ID's match and the value is between a given range

    Hello,
    I need to count those values in col B that have the same ID as in col D and whose value is >= the corresponding value in col E but <= the value in col F as given the attached example sheet.

    Any help will be highly appreciated.

    Best regards,
    guest
    Attached Files Attached Files

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Count entries in a range if the ID's match and the value is between a given range

    Try this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Registered User
    Join Date
    08-14-2013
    Location
    Pakistan
    MS-Off Ver
    Excel 2016
    Posts
    32

    Re: Count entries in a range if the ID's match and the value is between a given range

    @ Tsjallie. Thank you very much for your response. You have figured it right.

    After correcting my mistake by switching the places of columns E and F, the formula becomes:
    =SUMPRODUCT(--($A$2:$A$292=$D2),--($B$2:$B$292>=$E2),--($B$2:$B$292<=$F2))

    and it seems to work fine.

    Thanks a lot!

  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: Count entries in a range if the ID's match and the value is between a given range

    Quote Originally Posted by guest2013 View Post
    =SUMPRODUCT(--($A$2:$A$292=$D2),--($B$2:$B$292>=$E2),--($B$2:$B$292<=$F2))
    You could also use the more efficient COUNTIFS function...

    =COUNTIFS($A$2:$A$292,$D2,$B$2:$B$292,">="&$E2,$B$2:$B$292,"<="&$F2)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    08-14-2013
    Location
    Pakistan
    MS-Off Ver
    Excel 2016
    Posts
    32

    Re: Count entries in a range if the ID's match and the value is between a given range

    @Tony Valko. Thanks a lot for your response. Your solution has taught me that I was missing the use of "&" in my countifs formula.

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

    Re: Count entries in a range if the ID's match and the value is between a given range

    You're welcome. Thanks for the feedback!

+ 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. Count cells in a range that match a specific criteria in a different cell range
    By RhapsodyBay in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2015, 02:10 PM
  2. Formula Count Entries in a range if another range is = 1 and Another = Monday
    By realniceguy5000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-29-2011, 02:10 PM
  3. SumProduct Formula Count Entries in a range if another range is = 1
    By realniceguy5000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2011, 02:13 PM
  4. Replies: 25
    Last Post: 09-07-2005, 12:05 AM
  5. count no. of entries in range for a day
    By DeeJay30 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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