+ Reply to Thread
Results 1 to 2 of 2

Row count, for multiple criteria, with string search.

  1. #1
    Registered User
    Join Date
    07-20-2009
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Row count, for multiple criteria, with string search.

    Problem: I need to count rows where col1 has "Cow" and col2 has "Milk" (in the spreadsheet below)
    I am have written this formula, but the result is inaccurate (expected=3, actual=1).

    =SUMPRODUCT(('Sheet 1'!B2:B300="Cow")*('Sheet 1'!G2:G300="Milk"))

    Sample spreadsheet:

    Cow Milk
    Calf Cheese
    Cow and Calf Milk, Cheese
    Calf Cheese, Milk
    Cow and Calf Milk


    It looks like the exact word is matched. I've tried adding the wild character *, like "Cow*", but it doesn't work. What's missing here?? (I am not an excel programmer ) )

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Row count, for multiple criteria, with string search.

    Try

    =SUMPRODUCT(ISNUMBER(SEARCH("cow",'Sheet 1'!B2:B300))*ISNUMBER(SEARCH("milk",'Sheet 1'!G2:G300)))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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