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) )
Try
=SUMPRODUCT(ISNUMBER(SEARCH("cow",'Sheet 1'!B2:B300))*ISNUMBER(SEARCH("milk",'Sheet 1'!G2:G300)))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks