+ Reply to Thread
Results 1 to 9 of 9

Nested Count and indirect functions

  1. #1
    Registered User
    Join Date
    06-14-2013
    Location
    Cambridge,London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Nested Count and indirect functions

    Hello,

    Is there an obvious why the following formula does not work:

    =COUNT(INDIRECT("AA"&AG2)) but this one does:=COUNT(INDIRECT(AE9)). Thank you.

    jrbluebox

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Nested Count and indirect functions

    Hi
    It looks like you are trying to Concatenate column AA and cell AG2 which is why it wont work.
    Tony

  3. #3
    Registered User
    Join Date
    06-14-2013
    Location
    Cambridge,London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Nested Count and indirect functions

    Hi Tony,

    I am trying to build a cell address; AG2 contains a number. For example =INDIRECT("AA"&AG2) works fine - the ouput is a range - but somehow the count function does not recognise it.

    jrbluebox

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested Count and indirect functions

    =COUNT(INDIRECT("AA"&AG2))

    Works OK for me.

    If AG2 = 10 then the formula evaluates to:

    =COUNT($AA$10)

    Is that what you had in mind?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    06-14-2013
    Location
    Cambridge,London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Nested Count and indirect functions

    Is there a reason why the formula evaluates $AA$10 rather then Indirect($AA$10). Because $AA$10 is the output of ("$AA$"&10), but not of Indirect($AA$10). For the sake of the argument $AA$10 contains a range, for example B10:B1234. Thanks.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested Count and indirect functions

    Try this...

    =COUNT(INDIRECT(INDIRECT("AA"&AG2)))

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested Count and indirect functions

    Another way...

    =COUNT(INDIRECT(INDEX(AA:AA,AG2)))

  8. #8
    Registered User
    Join Date
    06-14-2013
    Location
    Cambridge,London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Nested Count and indirect functions

    Sorted! Thanks, Tony.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested Count and indirect functions

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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