+ Reply to Thread
Results 1 to 5 of 5

countif from tab dependent on cell value

  1. #1
    Registered User
    Join Date
    10-31-2010
    Location
    devon, england
    MS-Off Ver
    Excel 2007
    Posts
    8

    countif from tab dependent on cell value

    Hi

    I'm trying to use countif to count if cell C3 in Sheet 6 is equal to cell C2

    =COUNTIF(Sheet6!C3,C2)

    But I want to replace 'Sheet6!' with a cell reference so that whatever is in that cell will direct the queery to that tab, e.g.

    =COUNTIF('A1'!C3,C2)

    So if cell A1=Sheet6 it will use Sheet6 C3 as the range, but if I change A1 to Sheet7 it will use sheet 7 C3. I can't seem to get the syntax correct.

    I hope I've explained that correctly
    Last edited by kingy2; 08-14-2011 at 06:32 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: countif from tab dependent on cell value

    Try this ...

    Please Login or Register  to view this content.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: countif from tab dependent on cell value

    When using INDIRECT for sheet references it's generally a good idea to encase sheet reference within ' ' just in case...

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    remember too that you can use R1C1 notation with INDIRECT should you wish to adapt target reference across a range for ex.

  4. #4
    Registered User
    Join Date
    10-31-2010
    Location
    devon, england
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: countif from tab dependent on cell value

    Simples eh?

    Thanks very much

    Sorry, only used this site once and it was a while ago, do I do something to say thanks and mark thread as solved?

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: countif from tab dependent on cell value

    Yes, please mark the thread as solved, and if you'd like to thank DonkeyOte or myself then click on the scales icon at the top right of our posts.

+ 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