+ Reply to Thread
Results 1 to 10 of 10

Indirect with countifs

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    Colchester, England
    MS-Off Ver
    Excel 2010
    Posts
    28

    Indirect with countifs

    Hi.

    I've got a spreadsheet with multiple sheets. The front sheet is a summary sheet pulling certain information from the others using the indirect function i.e.

    Please Login or Register  to view this content.
    where A7 has the sheet name typed in


    I now need to include countifs using multiple criteria. I have managed to come up with the following, but I want to incorporate the indirect function so I don't have to keep changing the formula to include each sheets name

    Please Login or Register  to view this content.
    Can you please help me?

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Indirect with countifs

    Hi,

    Not sure, but try below formula:

    =SUMPRODUCT((INDIRECT(A7&"!$AM$9:AM$2000")="no")*((INDIRECT(A7&"!$AN$9:AN$2000")="for Sale")+(ISNUMBER(SEARCH("*on*",INDIRECT(A7&"!$AN$9:AN$2000"))))))

    Regards,

  3. #3
    Registered User
    Join Date
    01-22-2014
    Location
    Colchester, England
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Indirect with countifs

    Hi

    This works for all sheets where there is only one word as the sheet name, so for example "Colchester" in A7 and on the sheet name.

    Where there are two words in A7 and the sheet name I get #REF!, so where it is "Milton Keynes" in A7 and on the sheet name.

    Any ideas?

    Thanks.

  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
    53,048

    Re: Indirect with countifs

    change to...
    INDIRECT("'"&A7&"'!$AM$9:AM$2000")
    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

  5. #5
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Indirect with countifs

    Replace Indirect as below and change AM to AN.

    INDIRECT("'"&A7&"'!$AM$9:AM$2000")

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Indirect with countifs

    Hi.

    =SUM(COUNTIFS(INDIRECT("'"&A7&"'!AM9:AM2000"),"no",INDIRECT("'"&A7&"'!AN9:AN2000"),{"for Sale","*on*"}))

    Regards
    Click * below if this answer helped

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

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

    Re: Indirect with countifs

    try
    =SUM(COUNTIFS(INDIRECT("'"&A1&"'!AM$9:AM$2000"),"no",INDIRECT("'"&A1&"'!AN$9:AN$2000"),{"for Sale","*on*"}))
    snap!
    "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

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Indirect with countifs

    Indeed! Though of course you don't need to make references absolute when they're being passed as text strings.

  9. #9
    Registered User
    Join Date
    01-22-2014
    Location
    Colchester, England
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Indirect with countifs

    Thanks all, they work perfectly

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

    Re: Indirect with countifs

    i didnt on purpose,i just changed the original,it was quicker!

+ 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. COUNTIFS and INDIRECT function return #VALUE error - don't know why?
    By MikeRoot in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-26-2014, 02:37 PM
  2. [SOLVED] Using indirect with countifs
    By macnabong in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2014, 10:50 AM
  3. COUNTIFS with INDIRECT Formula Problem
    By GregM56 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-20-2014, 10:00 AM
  4. COUNTIFS and INDIRECT Function
    By Jeff9 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2014, 03:22 PM
  5. [SOLVED] Countifs,Indirect Function and Vlookup combined
    By Yari1986 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2013, 11:19 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