Results 1 to 4 of 4

Thread: Lookup & countif

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Lookup & countif

    I have data as below:
    31-May-11 -3.8%
    31-Aug-11 -3.5%
    30-Jun-10 -2.8%
    30-Nov-10 -2.8%
    30-Jun-11 -2.5%
    31-Mar-11 -2.3%
    31-Jan-10 -1.6%
    31-Jan-11 -1.1%
    30-Apr-10 -1.0%
    30-Nov-11 -0.9%
    31-Dec-11 -0.9%
    31-Jan-12 -0.7%
    31-Mar-12 0.2%
    31-Oct-10 0.7%
    29-Feb-12 0.8%
    30-Sep-11 1.0%
    31-Dec-10 2.3%
    31-Oct-11 2.3%
    31-Mar-10 3.0%
    31-Aug-10 4.1%
    31-Jul-10 4.9%
    30-Apr-11 5.8%
    30-Sep-10 6.9%
    28-Feb-10 9.1%

    I want to lookup the range as below & do a countif function.

    -10% to -9%
    -9% to -8%
    -8% to -7%
    -7% to -6%
    -6% to -5%
    -5% to -4%

    Please help

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi Babu,

    Please find attached.
    Attached Files Attached Files
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by Admin View Post
    Hi Babu,

    Please find attached.
    The formula you used in your attachment was this...

    =SUMPRODUCT(--($B$2:$B$25>=E2),--($B$2:$B$25<F2))

    An alternate formula that will produce the same results is this...

    =COUNTIF(B$2:B$25,"<"&F2)-COUNTIF(B$2:B$25,"<"&E2)

    I am not sure which of these two formulas would be more efficient. In my experience, the SUMPRODUCT function tends to be slow because, underneath it all, it is actually an array function that does not require using CTRL+SHIFT+ENTER to enable the array; however, making two COUNTIF function calls against the same data set might also be slow... I am just not sure.
    Last edited by Rick Rothstein; 03-25-2012 at 11:48 PM.

  4. #4
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0
    Both formuales work very well.

    Thanks

Similar Threads

  1. Replies: 3
    Last Post: 03-12-2013, 12:54 PM
  2. Integration Formulas & International Options
    By PcMax in forum Excel Help
    Replies: 5
    Last Post: 01-04-2013, 01:54 AM
  3. Lookup lookup lookup just can't make it work
    By work2live in forum Excel Help
    Replies: 1
    Last Post: 12-08-2012, 11:48 PM
  4. Delete unwanted rows & column
    By sanjeevi888 in forum Excel Help
    Replies: 1
    Last Post: 09-30-2012, 08:52 AM
  5. COUNTIF on Non-contiguous Range
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 04-23-2011, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •