+ Reply to Thread
Results 1 to 2 of 2

Using COUNTIF with Filters

  1. #1
    Registered User
    Join Date
    02-23-2005
    Posts
    1

    Unhappy Using COUNTIF with Filters

    Hi,

    I have a spreadsheet which has a list of various information in. Column A has customer name and then column b has the date an activity was completed by. At the bottom I have got a list of all the customers names and then used COUNTIF to calculate how many times they appear in the list. What I need to do is when the information is filtered between two data ranges it will only count the customers between that data range e.g. what is then displayed and not all the information like it is currently doing.

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try the following...

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-MIN(ROW(A2:A100)),0,1)),--(A2:A100="CustomerName"))

    If by 'filtered between two data ranges' you mean filtered between two dates in Column B, you can use the following formula without the need to apply the filter...

    =SUMPRODUCT(--(A2:A100="CustomerName"),--(B2:B100>="1/1/2005"+0),--(B2:B100<="1/31/2005"+0))

    OR

    =SUMPRODUCT(--(A2:A100="CustomerName"),--(B2:B100>=C1),--(B2:B100<=D1))

    ...where C1 contains the start date, and D1 the end date.

    Hope this helps!

    Quote Originally Posted by ravenrt
    Hi,

    I have a spreadsheet which has a list of various information in. Column A has customer name and then column b has the date an activity was completed by. At the bottom I have got a list of all the customers names and then used COUNTIF to calculate how many times they appear in the list. What I need to do is when the information is filtered between two data ranges it will only count the customers between that data range e.g. what is then displayed and not all the information like it is currently doing.

+ 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