+ Reply to Thread
Results 1 to 5 of 5

Countif with Concatenate not working properly

  1. #1
    Registered User
    Join Date
    12-07-2018
    Location
    Belfast, Ireland
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Countif with Concatenate not working properly

    Hi folks,

    I am trying to use the following formula to count the number of "W" values in a range - simple example below.

    =COUNTIF('Raw Data'!C55:C57,"W")

    But i want to C57 part of the range to be dynamic, based on a header date.

    Basically i want to the range to be built like this - the MATCH formula below returns a row number; say 57.

    CONCATENATE("'Raw Data'!C55:", "C", MATCH(D5,'Raw Data'!$B:$B,0))

    So I am using the following formula to get it.

    =COUNTIF(CONCATENATE("'Raw Data'!C55:", "C", MATCH(D5,'Raw Data'!$B:$B,0)),"W")

    But i keep getting "We found a problem with this formula" error.

    For info the following formula succesffuly returns 'Raw Data'!C55:C57

    =CONCATENATE("'Raw Data'!C55:", "C", MATCH(F5,'Raw Data'!$B:$B,0))

    So it seems to be the connect with the Countif formula.

    Am i doing something wrong with the syntax?

    Thanks in advance.
    Last edited by mickland; 12-07-2018 at 10:57 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    16,248

    Re: Countif with Concatenate not working properly

    You need to use the INDIRECT function to convert the string which represents a range reference into an actual reference that Excel can make use of. Try it this way:

    =COUNTIF(INDIRECT("'Raw Data'!C55:C" & MATCH(D5,'Raw Data'!$B:$B,0)),"W")

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-07-2018
    Location
    Belfast, Ireland
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Countif with Concatenate not working properly

    Pete - you are a wee star!

    Thanks!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    16,248

    Re: Countif with Concatenate not working properly

    You're welcome - glad to help.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  5. #5
    Registered User
    Join Date
    12-07-2018
    Location
    Belfast, Ireland
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Countif with Concatenate not working properly

    Done - Cheers

+ 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