multiple criteria with wildcard

Dookie

New Member
Joined
Apr 7, 2011
Messages
18
Please help...
I have this board

a b c
CARS 0800/0900 10
CARS -/1000 20
CARS -/1300 12
TRACKS 1500/- 15
TRACKS 1700/- 20
TRACKS 1700/1800 21
BIKES - 8
BIKES -/1800 9
BIKES 10

I want to count the for eg the cars (column a) which departed from my station (-/???), or to count the tracks which arrived and departed from my station (????/????).
I'm using these formulas:
SUM((A1:A9="CARS")*(ISNUMBER(SEARCH("-/";B1:B9;1)*C1:9)))
or
SUMPRODUCT((A1:A9="CARS")*(ISNUMBER(SEARCH("-/";B1:B9;1)*C1:9)))
and both of them gives me back 2 (the number of cells), not the count of the cars that match with my criteria (20+12=22)

Thank u in advance for your support!!:)
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Well to begin with, I think 20+12=32 :-)

Try this
Code:
=SUMPRODUCT(--(A1:A9="CARS"),--(LEFT(B1:B9,2)="-/"),C1:C9)
 
Upvote 0
All versions...
Code:
=SUMPRODUCT(
   --(A1:A9="CARS");
   --ISNUMBER(SEARCH("-/";B1:B9);
   C1:C9)
which yields a sum, not a count.

Also a sum on Excel 2007 or 2010...
Code:
=SUMIFS(
    C1:C9;
    A1:A9;"CARS";
    B1:B9;"*-/*)

Replace semi-colon with comma if you are on American system.
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top