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
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Company Name[/TD]
[TD]Category[/TD]
[TD]Distribution Type[/TD]
[TD]Codes[/TD]
[/TR]
[TR]
[TD]Bookran[/TD]
[TD]Book[/TD]
[TD]Truck[/TD]
[TD][TABLE="width: 91"]
<colgroup><col></colgroup><tbody>[TR]
[TD]AP6802400[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Telstar[/TD]
[TD]Book[/TD]
[TD]Cart[/TD]
[TD][TABLE="width: 91"]
<tbody>[TR]
[TD]IM1338917[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Major[/TD]
[TD]Pen[/TD]
[TD]Gate[/TD]
[TD]CH3117672[/TD]
[/TR]
[TR]
[TD]Bookran[/TD]
[TD]Book[/TD]
[TD]Truck[/TD]
[TD]CS6540201[/TD]
[/TR]
[TR]
[TD]Major[/TD]
[TD]Pen[/TD]
[TD]Gate[/TD]
[TD]TN9358217[/TD]
[/TR]
</tbody>[/TABLE]

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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Company Name[/TD]
[TD]Category[/TD]
[TD]Distribution Type[/TD]
[TD]Codes[/TD]
[/TR]
[TR]
[TD]Bookran[/TD]
[TD]Book[/TD]
[TD]Truck[/TD]
[TD][TABLE="width: 91"]
<tbody>[TR]
[TD]AP6802400[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Telstar[/TD]
[TD]Book[/TD]
[TD]Cart[/TD]
[TD][TABLE="width: 91"]
<tbody>[TR]
[TD]IM1338917[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Major[/TD]
[TD]Pen[/TD]
[TD]Gate[/TD]
[TD]CH3117672[/TD]
[/TR]
[TR]
[TD]Bookran[/TD]
[TD]Book[/TD]
[TD]Truck[/TD]
[TD]CS6540201[/TD]
[/TR]
[TR]
[TD]Major[/TD]
[TD]Pen[/TD]
[TD]Gate[/TD]
[TD]TN9358217[/TD]
[/TR]
</tbody>[/TABLE]

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,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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