+ Reply to Thread
Results 1 to 5 of 5

Sumproduct to Count Text

  1. #1
    Registered User
    Join Date
    04-09-2012
    Location
    Philadelphia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Sumproduct to Count Text

    Hello everyone, and thanks in advanced for your help. Here is my problem:

    I have Excel 2003 at my office and I am trying to use the sumproduct function to count the number of times certain text appears. I receive data weekly which contain the names of firms that we do business with. Sounds easy enough, but the problem is that sometimes the firms are listed differently (eg. ABC Inc; ABC, Inc.; ABC). My solution was to add another sumproduct term, but I am unsure if the data will show an alternate firm name in the coming weeks.

    Is there a way to use sumproduct to count all the cells of text that contain the phrase "ABC" indeterminate of what else is in the cell?

    Current formula: =SUMPRODUCT(--(Data!A2:A3000="person")*(--(Data!G2:G3000="ABC")+(--(Data!G2:G3000="ABC, LLC"))+(--(Data!G2:G3000="ABC LLC"))))

    Preferred formula: =SUMPRODUCT(--(Data!A2:A3000="person")*(--(Data!G2:G3000=("cell contains ABC")))

    Thank you again for your expertise.
    Last edited by jnweiss; 04-09-2012 at 09:14 AM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Sumproduct to Count Text

    Hi there, welcome to the Forum!

    Try using ISNUMBER(FIND()) like this

    =SUMPRODUCT(--(Data!A2:A3000="person")*--(ISNUMBER(FIND("ABC",Data!G2:G3000))))
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    04-09-2012
    Location
    Philadelphia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Sumproduct to Count Text

    Worked perfectly! Thank you so much

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Sumproduct to Count Text

    Glad i could help, could you please mark this thread as solved?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Sumproduct to Count Text

    Quote Originally Posted by DGagnon View Post
    =SUMPRODUCT(--(Data!A2:A3000="person")*--(ISNUMBER(FIND("ABC",Data!G2:G3000))))
    This formula will work but, really, you are mixing up syntaxes unnecessarily here, if you use * you don't need -- and vice versa, so probably you would normally use either this version

    =SUMPRODUCT((Data!A2:A3000="person")*ISNUMBER(FIND("ABC",Data!G2:G3000)))

    ....where multiplying the two arrays using * implicitly co-erces the TRUEs to 1s and the FALSEs to zeroes, or this one.....

    =SUMPRODUCT(--(Data!A2:A3000="person"),--ISNUMBER(FIND("ABC",Data!G2:G3000)))

    where -- explicitly co-erces each array
    Last edited by daddylonglegs; 04-09-2012 at 10:24 AM.
    Audere est facere

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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