Advanced Count Formula

natheplas

Board Regular
Joined
Aug 28, 2016
Messages
97
Hello,

I am trying to count how many unique kits I have in excel. (A group of rows)

Each Kit Starts with a P in column G and ends with the last C, before the next P, in column G.

I need a formula that can identify the kits using the above logic and count how many unique kits there are please?

Can anyone help with this?

If you need more information, please let me know.

Ran the L2BB below:

Book9
ABCDEF
1Product CodeProduct DescriptionParent or ChildKit ClassQtySO Optional
219605A1 DDO170 KITPS0
302046DDO 170-500 MOUNT FOOTCS1Y
416107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
518718A1 JM150 RH P400 KITPS0
603211JM150 PCB 24V V2 RH 9TCS1N
716157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
803233PP400N SOLENOID (S)CS1Y
918719A1 JM150 LH P400 KITPS0
1003212JM150 PCB 24V V2 LH 9TCS1Y
1116157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
1203233PP400N SOLENOID (S)CS1N
1319605A1 DDO170 KITPS0
1403000VDDO170 KE 3PH 60% M HPCS1Y
1502046DDO 170-500 MOUNT FOOTCS1Y
1616107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
1719605A1 DDO170 KITPS0
1802046DDO 170-500 MOUNT FOOTCS1Y
1916107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
2018734A1 JM200 RH P400 KITPS0
2103207JM200 MTR 3PH PCBL V2 RH 9TCS1Y
2216157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
2303233PP400N SOLENOID (S)CS1Y
2418717A1 JM150 LH P300 KITPS0
2503212JM150 PCB 24V V2 LH 9TCS1N
2616157JM TO BRAKE JOIN CABLE 7MTRSCS1N
2703231PP300N FUSE RELEASE UNITCS1N
2818717A1 JM150 LH P300 KITPS0
2903212JM150 PCB 24V V2 LH 9TCS1N
3016157JM TO BRAKE JOIN CABLE 7MTRSCS1N
3103231PP300N FUSE RELEASE UNITCS1N
3218717A1 JM150 LH P300 KITPS0
3303212JM150 PCB 24V V2 LH 9TCS1N
3416157JM TO BRAKE JOIN CABLE 7MTRSCS1N
3503231PP300N FUSE RELEASE UNITCS1N
3618717A1 JM150 LH P300 KITPS0
3703212JM150 PCB 24V V2 LH 9TCS1N
3816157JM TO BRAKE JOIN CABLE 7MTRSCS1N
3903231PP300N FUSE RELEASE UNITCS1N
4018730A1 JM500 1Ph RH P400 KITPS0
4103201JM500 MTR 1PH PCB V2 RHCS1N
4216106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
4316157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
4403233PP400N SOLENOID (S)CS1Y
4518730A1 JM500 1Ph RH P400 KITPS0
4603201JM500 MTR 1PH PCB V2 RHCS1N
4716106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
4816157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
4903233PP400N SOLENOID (S)CS1Y
5018730A1 JM500 1Ph RH P400 KITPS0
5103201JM500 MTR 1PH PCB V2 RHCS1N
5216106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
5316157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
5403233PP400N SOLENOID (S)CS1Y
5518730A1 JM500 1Ph RH P400 KITPS0
5603201JM500 MTR 1PH PCB V2 RHCS1N
5716106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
5816157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
5903233PP400N SOLENOID (S)CS1Y
6018717A1 JM150 LH P300 KITPS0
6103212JM150 PCB 24V V2 LH 9TCS1N
6216157JM TO BRAKE JOIN CABLE 7MTRSCS1N
6303231PP300N FUSE RELEASE UNITCS1N
6418716A1 JM150 RH P300 KITPS0
6516157JM TO BRAKE JOIN CABLE 7MTRSCS1N
6618717A1 JM150 LH P300 KITPS0
6703212JM150 PCB 24V V2 LH 9TCS1N
6816157JM TO BRAKE JOIN CABLE 7MTRSCS1N
6903231PP300N FUSE RELEASE UNITCS1N
7018716A1 JM150 RH P300 KITPS0
7116157JM TO BRAKE JOIN CABLE 7MTRSCS1N
7218731A1 JM500 1Ph LH P400 KITPS0
7303202JM500 MTR 1PH PCB V2 LHCS1N
7416106JM 500 11T SPKT ONLY 1/2X5/16"CS1Y
7516157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
7603233PP400N SOLENOID (S)CS1Y
7718730A1 JM500 1Ph RH P400 KITPS0
7803201JM500 MTR 1PH PCB V2 RHCS1N
7916106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
8016157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
8103233PP400N SOLENOID (S)CS1Y
8218731A1 JM500 1Ph LH P400 KITPS0
8303202JM500 MTR 1PH PCB V2 LHCS1N
8416106JM 500 11T SPKT ONLY 1/2X5/16"CS1Y
8516157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
8603233PP400N SOLENOID (S)CS1Y
8718730A1 JM500 1Ph RH P400 KITPS0
8803201JM500 MTR 1PH PCB V2 RHCS1N
8916106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
9016157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
9103233PP400N SOLENOID (S)CS1Y
9218717A1 JM150 LH P300 KITPS0
9303212JM150 PCB 24V V2 LH 9TCS1N
9416157JM TO BRAKE JOIN CABLE 7MTRSCS1N
9503231PP300N FUSE RELEASE UNITCS1N
9618716A1 JM150 RH P300 KITPS0
9716157JM TO BRAKE JOIN CABLE 7MTRSCS1N
9818731A1 JM500 1Ph LH P400 KITPS0
9903202JM500 MTR 1PH PCB V2 LHCS1N
10016106JM 500 11T SPKT ONLY 1/2X5/16"CS1Y
10116157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
10203233PP400N SOLENOID (S)CS1Y
10318730A1 JM500 1Ph RH P400 KITPS0
10403201JM500 MTR 1PH PCB V2 RHCS1N
10516106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
10616157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
10703233PP400N SOLENOID (S)CS1Y
10818717A1 JM150 LH P300 KITPS0
10903212JM150 PCB 24V V2 LH 9TCS1N
11016157JM TO BRAKE JOIN CABLE 7MTRSCS1N
11103231PP300N FUSE RELEASE UNITCS1N
11218716A1 JM150 RH P300 KITPS0
11316157JM TO BRAKE JOIN CABLE 7MTRSCS1N
11418730A1 JM500 1Ph RH P400 KITPS0
11503201JM500 MTR 1PH PCB V2 RHCS1N
11616106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
11716157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
11803233PP400N SOLENOID (S)CS1Y
11918730A1 JM500 1Ph RH P400 KITPS0
12003201JM500 MTR 1PH PCB V2 RHCS1N
12116106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
12216157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
12303233PP400N SOLENOID (S)CS1Y
12418722A1 JM500 3Ph RH P400 KITPS0
12503205JM500 MTR 3PH PCB V2 RHCS1N
12616106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
12716157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
12803233PP400N SOLENOID (S)CS1Y
12918730A1 JM500 1Ph RH P400 KITPS0
13003201JM500 MTR 1PH PCB V2 RHCS1N
13116106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
13216157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
13303233PP400N SOLENOID (S)CS1Y
13418731A1 JM500 1Ph LH P400 KITPS0
13503202JM500 MTR 1PH PCB V2 LHCS1N
13616106JM 500 11T SPKT ONLY 1/2X5/16"CS1Y
13716157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
13803233PP400N SOLENOID (S)CS1Y
13919606A1 DDO260 KITPS0
14016109SHAFT KEYED 40MM MDF3/DDOCS1Y
141070785 MTR OPTICAL SAFETY EDGE KITPS0
14209009C CHANNEL GALVCS5Y
14307099OPTICAL S/EDGE P3 RUBBERCS5Y
14407094AOPTICAL S/EDGE 5 CORE CURLYCS1Y
14507095OPTO S/EDGE JUNCTION BOX C/WCS2Y
14607096BUMPER TO SUIT P2 / P3 RUBBERCS1Y
14708008REDUCING PLUGS FOR P3 RUBBERCS1N
14819605A1 DDO170 KITPS0
14903000VDDO170 KE 3PH 60% M HPCS1Y
15002046DDO 170-500 MOUNT FOOTCS1Y
15116107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
15219606A1 DDO260 KITPS0
15316109SHAFT KEYED 40MM MDF3/DDOCS1Y
154070785 MTR OPTICAL SAFETY EDGE KITPS0
15509009C CHANNEL GALVCS5Y
15607099OPTICAL S/EDGE P3 RUBBERCS5Y
15707094AOPTICAL S/EDGE 5 CORE CURLYCS1Y
15807095OPTO S/EDGE JUNCTION BOX C/WCS2Y
15907096BUMPER TO SUIT P2 / P3 RUBBERCS1Y
16008008REDUCING PLUGS FOR P3 RUBBERCS1N
16119605A1 DDO170 KITPS0
16203000VDDO170 KE 3PH 60% M HPCS1Y
16302046DDO 170-500 MOUNT FOOTCS1Y
16416107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
16519606A1 DDO260 KITPS0
16616109SHAFT KEYED 40MM MDF3/DDOCS1Y
167070785 MTR OPTICAL SAFETY EDGE KITPS0
16809009C CHANNEL GALVCS5Y
16907099OPTICAL S/EDGE P3 RUBBERCS5Y
17007094AOPTICAL S/EDGE 5 CORE CURLYCS1Y
17107095OPTO S/EDGE JUNCTION BOX C/WCS2Y
17207096BUMPER TO SUIT P2 / P3 RUBBERCS1Y
17308008REDUCING PLUGS FOR P3 RUBBERCS1N
17419605A1 DDO170 KITPS0
17503000VDDO170 KE 3PH 60% M HPCS1Y
17602046DDO 170-500 MOUNT FOOTCS1Y
17716107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
17818718A1 JM150 RH P400 KITPS0
17903211JM150 PCB 24V V2 RH 9TCS1N
18016157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
18103233PP400N SOLENOID (S)CS1Y
18218730A1 JM500 1Ph RH P400 KITPS0
18303201JM500 MTR 1PH PCB V2 RHCS1N
18416106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
18516157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
18603233PP400N SOLENOID (S)CS1Y
18719601A1 100M 94MM METAL ADAPTOR KITPS0
18811349ED59/100M 93MM METAL ADAPTORCS1N
18918730A1 JM500 1Ph RH P400 KITPS0
19003201JM500 MTR 1PH PCB V2 RHCS1N
19116106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
19216157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
19303233PP400N SOLENOID (S)CS1Y
19418722A1 JM500 3Ph RH P400 KITPS0
19503205JM500 MTR 3PH PCB V2 RHCS1N
19616106JM 500 11T SPKT ONLY 1/2X5/16"CS1N
19716157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
19803233PP400N SOLENOID (S)CS1Y
19918731A1 JM500 1Ph LH P400 KITPS0
20003202JM500 MTR 1PH PCB V2 LHCS1N
20116106JM 500 11T SPKT ONLY 1/2X5/16"CS1Y
20216157JM TO BRAKE JOIN CABLE 7MTRSCS1Y
20303233PP400N SOLENOID (S)CS1Y
Sheet3
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
if "kit" is in the name of everyone in column B, then you could use
Excel Formula:
=COUNTIF(B:B,"*kit*")
or you could count the number of P in column C
Excel Formula:
=COUNTIF(C:C,"P")
 
Upvote 0
Thank you for coming back to me ExceLoki, it's a bit more complicated than that.

In the L2BB example below, the answer would be 2. As there are 3 kits, but there are 2 permutations of kits.

19605
02046
16107

Appears twice.

19605
02046
03000V

Appears once.

Are you able to help with that please?

Book9
IJKLMN
1Product CodeProduct DescriptionParent or ChildKit ClassQtySO Optional
219605A1 DDO170 KITPS0
302046DDO 170-500 MOUNT FOOTCS1Y
416107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
519605A1 DDO170 KITPS0
602046DDO 170-500 MOUNT FOOTCS1Y
703000VDDO170 KE 3PH 60% M HPCS1Y
819605A1 DDO170 KITPS0
902046DDO 170-500 MOUNT FOOTCS1Y
1016107SHAFT KEYED 30MM MDF 1 & 2 (S)CS1Y
Sheet3
 
Upvote 0
in your example above P appears 3 times in column K, each with the same product code in column I.
this would count as 3, but you said it should be counted as 2.
is it based on the three product codes?
ex: if all three product codes are the same then it doesnt count again, but if one is different then it does count again?

trying to clarify what needs to be compared.
 
Upvote 0
Thanks Loki.

So each kit (product grouping) is denoted by a P and then 1 or more C's in column K (it won't always be 2 Cs)

Each kit ends with the last C.

Each new kit starts with the next P.

Each kit can have 1 P, but a different number of Cs.

The Ps and Cs are made up of product codes (names) in column I.

Each kit has a variation of different product codes in column I.

In the example above there are 3 kits. All 3 have one P and two Cs.

Two kits are made up of

19605
02046
16107

And 1 kit is made up of

19605
02046
03000V

So my count needs to be 2.

Counting not the number of kits, but the number of permutations.

Does that make sense? I know it's a lot.

Ideally I need to count the number of permutations, but also be able to remove any duplicate kits. Leaving a list of kits with unique permutations.

Thank you
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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