+ Reply to Thread
Results 1 to 17 of 17

Changing a CountIf Range so it read the end row from a cell

  1. #1
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Changing a CountIf Range so it read the end row from a cell

    Hey guys,

    This one should be really easy to fix but I can't remember how I did this before.

    In B12 I have the number: 49231 which changes every few days

    I have the following formula in my sheet:
    Please Login or Register  to view this content.
    I am wanting the countif to read the number 49231 from B12 instead of the 100000

    So it acts something like:
    Please Login or Register  to view this content.
    I've tried all sorts of things like:
    Please Login or Register  to view this content.

    Thanks in advance
    - Hyflex

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Changing a CountIf Range so it read the end row from a cell

    Hi

    Take a look, here.

    http://www.excelforum.com/excel-work...med-range.html
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Changing a CountIf Range so it read the end row from a cell

    Hi Hyflex,

    If you wanted to check if Range QJ18 : QJ100000 has B12 i.e., 49231, use the reference of B12 in place of QM17.... does this solves your query.?

    But if you want your range i.e. QJ18 : QJ100000 to be dynamic where end of the range can be determined by B12, use Offset function to define the dynamic name.
    Do little googling on this, else post a sample file. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Changing a CountIf Range so it read the end row from a cell

    @dilipandey

    Better to use your example in the thread that i linked, in my previous post

  5. #5
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Changing a CountIf Range so it read the end row from a cell

    Hey Fotis1991,

    Thanks for your reply, unfortunately that isn't what I'm looking for I need it to look at the exact range instead of the entire column but the exact range changes each day however the value for the end row is located in B12

    Thanks once again
    - Hyflex

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Changing a CountIf Range so it read the end row from a cell

    Yes... Fotis.. Thanks for the heads-up...

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Changing a CountIf Range so it read the end row from a cell

    So, it's better, as Dilip said, to upload a small sample workbook.

  8. #8
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Changing a CountIf Range so it read the end row from a cell

    Hey guys,

    I've attached a simple example, please take a look.

    Thanks for both your help so far, it's much appreciated.
    Attached Files Attached Files

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Changing a CountIf Range so it read the end row from a cell

    Or, give a try to this, first...

    =COUNTIF($QJ$18:INDIRECT(B12),OM17))

    In B12, you'll type the cell reference, like Q252, FOR EXAMPLE..


    Is this, works for you?

  10. #10
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Changing a CountIf Range so it read the end row from a cell

    Hyflex,

    Using your example file, this formula in cell K2 should do the trick:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  11. #11
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Changing a CountIf Range so it read the end row from a cell

    Quote Originally Posted by Fotis1991 View Post
    Or, give a try to this, first...

    =COUNTIF($QJ$18:INDIRECT(B12),OM17))

    In B12, you'll type the cell reference, like Q252, FOR EXAMPLE..

    Is this, works for you?
    That looks like it should work but I can't get it to work in my example I've tried:

    Please Login or Register  to view this content.
    but it returns #REF

    Quote Originally Posted by tigeravatar View Post
    Hyflex,

    Using your example file, this formula in cell K2 should do the trick:
    Please Login or Register  to view this content.
    Looks good but won't hundreds of these start to create lag over sheets what expand over to JFD and down to 200k


    Thanks guys for your help

  12. #12
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Changing a CountIf Range so it read the end row from a cell

    See this workbook, best to avoid volatile functions such as INDIRECT()
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  13. #13
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Changing a CountIf Range so it read the end row from a cell

    Quote Originally Posted by Hyflex View Post
    but won't hundreds of these start to create lag over sheets what expand over to JFD and down to 200k
    Generally speaking, any time a worksheet is that large you're going to see Excel slow down. When you have that much data, I would recommend using a database application like Access or Oracle instead of Excel.

    As far as the fomula itself, the formula Marcol and I proposed uses Index which is not a volatile function, and it doesn't actually look at the whole column, it just gets the position you designated in cell B12, so it is being used to only look at a specified range. I can't really think of a better way to do what you're asking. The only way to find out if it will be of use is to try it out on your actual workbook.

  14. #14
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Changing a CountIf Range so it read the end row from a cell

    As far as the fomula itself, the formula Marcol and I proposed uses Index which is not a volatile function, and it doesn't actually look at the whole column, it just gets the position you designated in cell B12, so it is being used to only look at a specified range. I can't really think of a better way to do what you're asking. The only way to find out if it will be of use is to try it out on your actual workbook.
    Angree with Tiger!

  15. #15
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Changing a CountIf Range so it read the end row from a cell

    @Fotis, I meant no offense, and I apologize if I accidentally insulted you

  16. #16
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Changing a CountIf Range so it read the end row from a cell

    No, NO, my friend. No need to apologize for anything.

    Pls, don't worry!


    In this case, Marcol's way, is better..

  17. #17
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Changing a CountIf Range so it read the end row from a cell

    Thank you ever so much guys, your help is very much appreciated.

    I've added to your reputations.

    Thanks once again
    - Hyflex

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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