+ Reply to Thread
Results 1 to 6 of 6

Countifs/Sumproduct for filtered data, searching if cell contains text

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2007
    Posts
    17

    Countifs/Sumproduct for filtered data, searching if cell contains text

    Hello,

    I am trying to get a formula to work inside a table, to count how many times text appears. However, I will be filtering the data and therefore would want only visable cells to be counted. Also, the there maybe more text in the box, for example, I will be looking for "Birds" and the text may contain "Lizards, Birds and Fish".

    I have tried two different formulas, the first-

    =COUNTIF(B2:B10, "*"&B1&"*") Where B1 contains Birds

    This returns the correct results, but does not take into account filtering.

    The second formula, which I input after changing the data set to a table, as I thought this would help with the filtering process is-

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(Table1[Type],ROW(Table1[Type]-MIN(ROW(Table1[Type])),,1))*(Table1[Type]=B1))

    This formula works when filtered, however only includes results for exact results, I have tried altering this to end with (Table1[Type]="*"&B1&"*")) but have had no success.

    Any help is greatly appreciated.

    Thanks you

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Countifs/Sumproduct for filtered data, searching if cell contains text

    Try for instance:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    PS. As we have now FORMULA tags available - please consider using them in the future (not yet required by forum rules).
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    09-10-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Countifs/Sumproduct for filtered data, searching if cell contains text

    Apologies for the late reply.

    Thank you for the reply, however it seems to return zeroes.

    Any reason why this may occur?

    Thanks,

    Dan

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Countifs/Sumproduct for filtered data, searching if cell contains text

    No idea. 2 days ago I prepared tiny sample file to test it. It worked. But then I deleted file.

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Countifs/Sumproduct for filtered data, searching if cell contains text

    Can you post your workbook so that potential answers are appropriate to the problem posted?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Registered User
    Join Date
    09-10-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Countifs/Sumproduct for filtered data, searching if cell contains text

    Hi,

    Attached is the workbook.

    If you look at the summary page, on the second row is where I am currently using the countif formula, however this does not alter as I filter the table in the 1st tab.

    Any help is much appreciated.

    Thanks,

    Dan
    Attached Files Attached Files

+ 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. [SOLVED] how to write COUNTIFS formula for testing only FILTERED data
    By aaaaa34 in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 03-09-2014, 07:40 AM
  2. Help with Sumproduct searching cell contents
    By jwillis07 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-11-2013, 09:49 AM
  3. CountIfs on a Filtered list?
    By Thymoolean in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2013, 08:25 PM
  4. [SOLVED] Counting number of data that meets 2 criteria (sumproduct and countifs?)
    By tekobayashi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-26-2012, 02:30 AM
  5. [SOLVED] Countifs same data text and same cell background color?
    By ORAM in forum Excel General
    Replies: 4
    Last Post: 09-10-2012, 12:18 PM

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