Formula to search 3 or more criteria, then count text

Kthom019

New Member
Joined
May 16, 2017
Messages
46
I need help putting together a formula that will do the following:
1. Search for company name "ABC" in column A, then
2. Search for product category "Books" in column B, (there a 6 different product categories that I will be searching for), then
3. Search for product distribution type "truck" in column C, then
4. If the above criteria are met then, count the "alphanumeric codes" in column D
Company NameCategoryDistribution TypeCodes
BookranBookTruck
AP6802400

<colgroup><col></colgroup><tbody>
</tbody>
TelstarBookCart
IM1338917

<tbody>
</tbody>
MajorPenGateCH3117672
BookranBookTruckCS6540201
MajorPenGateTN9358217

<tbody>
</tbody>

I hope the information above is sufficient, I am creating a reporting sheet to pull data from this detailed sheet with thousands of records.

Please assist soonest; thanks.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Thank you very much, I achieved success with the first formula. I will try the SUMPRODUCT formula as well.
 
Upvote 0
Formula 1. "COUNTIFS" worked; thank you. I will try the SUMPRODUCT as well.

1. COUNTIFS(A2:A1000,"x",B2:B1000,"y",C2:C1000,"z")

2. SUMPRODUCT(--(A2:A1000="x"),--(B2:B1000="y"),--(C2:C1000="z"))

Using dynamic named ranges, number of records sufficiently large...

3. COUNTIFS(Arange,"x",Brange,"y",Crange,"z")

4. SUMPRODUCT(--(Arange="x"),--(Brange="y"),--(Crange="z"))

5. COUNTIFS(A:A,"x",B:B,"y",C:C,"z")

6. SUMPRODUCT(--(A1:An="x"),--(B1:Bn="y"),--(C1:Cn="z"))

1 and 3 will be faster than their equivalents, i.e. 2 and 4.

If n of [6] is not larger than a limit, it will be faster than [5]. I'm not sure what that n would be.
 
Upvote 0
Yes, the COUNTIF formula worked; thanks Aladin.

Use COUNTIFS which is faster: See post #3 .

If you can't, try:

=SUMPRODUCT(--($A:$A=$F1),--($B:$B=$G1),--($C:$C=$H1),--ISNUMBER(SEARCH("?*",$D:$D))

Try to avoid whole column references in a SumProduct formula for reasons of efficiency.
 
Upvote 0
Thank you all ever so much for the quick replies and suggestions; the COUNTIF function worked pretty well.
I will continue to try the SUMPRODUCT.

I need help putting together a formula that will do the following:
1. Search for company name "ABC" in column A, then
2. Search for product category "Books" in column B, (there a 6 different product categories that I will be searching for), then
3. Search for product distribution type "truck" in column C, then
4. If the above criteria are met then, count the "alphanumeric codes" in column D
Company NameCategoryDistribution TypeCodes
BookranBookTruck
AP6802400

<tbody>
</tbody>
TelstarBookCart
IM1338917

<tbody>
</tbody>
MajorPenGateCH3117672
BookranBookTruckCS6540201
MajorPenGateTN9358217

<tbody>
</tbody>

I hope the information above is sufficient, I am creating a reporting sheet to pull data from this detailed sheet with thousands of records.

Please assist soonest; thanks.
 
Upvote 0

Forum statistics

Threads
1,216,741
Messages
6,132,448
Members
449,728
Latest member
teodora bocarski

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