+ Reply to Thread
Results 1 to 10 of 10

COUNTIF with INDIRECT Function

  1. #1
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    COUNTIF with INDIRECT Function

    hi Guys

    Can't seem to get this right?

    =COUNTA('Jan 2011'!L:L)-1, want to use indirect function to ref cell B8 which has Jan 2011 so formula will be dynamic enough to use c8 Feb 2011, d8 Mar 2011 etc

    =COUNTA((INDIRECT("'"&B8&"'!")*L:L)-1)- just gives 1

    thanks

    Noel
    Last edited by somesoldiers; 03-24-2011 at 07:13 AM.

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

    Re: COUNTIF with INDIRECT Function

    You need to include Column L in your string - INDIRECT essentially converts a string to a range

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: COUNTIF with INDIRECT Function

    Thanks DonleyOte- that works, is the countif fuction different- can't seem to apply below?

    =COUNTIF(INDIRECT(“’”&B$8&”'!L:L”,"CONFIRMED"))

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

    Re: COUNTIF with INDIRECT Function

    Your closing parentheses are misplaced - you should have one to close INDIRECT (prior to specifying COUNTIF criteria) and one to close the COUNTIF.

  5. #5
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: COUNTIF with INDIRECT Function

    got it, thanks

    =COUNTIF(INDIRECT("'"&B8&"'!L:L"),"CONFIRMED")

  6. #6
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: COUNTIF with INDIRECT Function

    Hi Guys

    back again, I would like to count where both BB = A17 and LL = CONFIRMED, below is adding amount of times each occurs. probably need an array but could never get to grip with these

    Thanks lot

    Noel

    =COUNTIF(INDIRECT("'"&B$9&"'!B:B"),$A17)+COUNTIF(INDIRECT("'"&B9&"'!L:L"),"CONFIRMED")

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

    Re: COUNTIF with INDIRECT Function

    XL2007 and above use COUNTIFS

    Prior to XL2007 you're left with SUMPRODUCT - given you're using this in conjunction with INDIRECT (Volatile) be sure to use in moderation - also keep precedent ranges optimised (small as possible)

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: COUNTIF with INDIRECT Function

    Got it, thanks again

  9. #9
    Registered User
    Join Date
    03-08-2011
    Location
    Cape town
    MS-Off Ver
    Excel 2007
    Posts
    4

    Unhappy Re: COUNTIF with INDIRECT Function

    Hello Somesoldiers and DonkeyOte.. Please help..

    For one comment by somesoldiers, there was a problem with parantheses and then it was posted that this formula works
    =COUNTIF(INDIRECT("'"&B8&"'!L:L"),"CONFIRMED")

    But I have been struggling for the past few hours to fix my formula =COUNTIF(INDIRECT(“‘”&A1&“‘!$B$1:$B$100),"test") . It doesn't work. I am using Excel 2010

    I also copied the formula that SOMESOLDIERS managed to use successfully. =COUNTIF(INDIRECT("'"&B8&"'!L:L"),"CONFIRMED") It doesn't work either. Any quick help will be highly appreciated.

    Also, please note that its not a #REF error , it is the pop up complaining "The formula you typed contains an error"
    Last edited by jobindaniel; 01-20-2012 at 10:52 AM. Reason: forgot to add something

  10. #10
    Registered User
    Join Date
    03-08-2011
    Location
    Cape town
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIF with INDIRECT Function

    I solved the problem... It was so silly..
    I copied the formula from a web page initially and the double quotes (") were wrongly interpreted by excel. I am not sure if anyone has heard this before. But thesame formula worked when I typed it myself. Thanks anyways .

+ 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