+ Reply to Thread
Results 1 to 5 of 5

COUNTIF Variable Range.

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    Nevada
    MS-Off Ver
    Excel 2010
    Posts
    2

    COUNTIF Variable Range.

    Hello, I have a number of COUNTIF functions that I need to work with different ranges that will be changed by a particular variable. In other words I am trying to write COUNTIF(C1:Cx,1) where x is the output of a specific cell. I am totally stumped on this. Thanks in advance for any help.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: COUNTIF Variable Range.

    Hi and welcome to the forum

    give this a try...
    =COUNTIF(indirect("C1:C"&A1),1 where A1 contains x
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    Nevada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: COUNTIF Variable Range.

    It worked perfectly! Thank you for the help (and the greeting).

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: COUNTIF Variable Range.

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIF Variable Range.

    another alternative avoiding indirect
    =COUNTIF(C1:INDEX(C:C,A1),1)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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. Countif and Variable Date Range
    By neilfleming in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-26-2012, 11:48 AM
  2. [SOLVED] Excel 2007 : Variable Range in Countif
    By themaster25 in forum Excel General
    Replies: 6
    Last Post: 04-09-2012, 06:30 AM
  3. Alternative to COUNTIF with Variable Range
    By fervorking in forum Excel General
    Replies: 2
    Last Post: 07-21-2011, 05:03 PM
  4. Countif with activecell.row variable for range?
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2011, 11:45 AM
  5. variable range in a COUNTIF statment
    By Sabean in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2006, 08:10 AM

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