+ Reply to Thread
Results 1 to 4 of 4

Using Sumproduct to count text occurence

  1. #1
    Dave
    Guest

    Using Sumproduct to count text occurence

    I'm counting excel records (rows) using the following conditions:

    =SUMPRODUCT((Ship05!$A$2:$A$428<>"")*(Ship05!$B$2:$B$428>DATEVALUE("03/31/05"))*(Ship05!$B$2:$B$428<=DATEVALUE("06/30/05"))*(Ship05!$M$2:$M$428="Freight
    Damage"))

    Instead of "Freight Damage" in column M, I want use a wildcard to count the
    records containing other "Freight" text strings.
    --
    Dave

  2. #2
    Barb Reinhardt
    Guest

    RE: Using Sumproduct to count text occurence

    You might be able to use

    ISNUMBER(search("Freight",Ship05!$M$2:$M$428))

    "Dave" wrote:

    > I'm counting excel records (rows) using the following conditions:
    >
    > =SUMPRODUCT((Ship05!$A$2:$A$428<>"")*(Ship05!$B$2:$B$428>DATEVALUE("03/31/05"))*(Ship05!$B$2:$B$428<=DATEVALUE("06/30/05"))*(Ship05!$M$2:$M$428="Freight
    > Damage"))
    >
    > Instead of "Freight Damage" in column M, I want use a wildcard to count the
    > records containing other "Freight" text strings.
    > --
    > Dave


  3. #3
    Dave
    Guest

    RE: Using Sumproduct to count text occurence

    That worked! How would I express the negative of that; i.e., count records
    that did not contain "Freight"?
    --
    Dave


    "Barb Reinhardt" wrote:

    > You might be able to use
    >
    > ISNUMBER(search("Freight",Ship05!$M$2:$M$428))
    >
    > "Dave" wrote:
    >
    > > I'm counting excel records (rows) using the following conditions:
    > >
    > > =SUMPRODUCT((Ship05!$A$2:$A$428<>"")*(Ship05!$B$2:$B$428>DATEVALUE("03/31/05"))*(Ship05!$B$2:$B$428<=DATEVALUE("06/30/05"))*(Ship05!$M$2:$M$428="Freight
    > > Damage"))
    > >
    > > Instead of "Freight Damage" in column M, I want use a wildcard to count the
    > > records containing other "Freight" text strings.
    > > --
    > > Dave


  4. #4
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333

    Using Sumproduct to count text occurence

    how about

    NOT(ISNUMBER(search("Freight",Ship05!$M$2:$M$428)))
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

+ 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