Count Functions

geoffbird

New Member
Joined
Sep 25, 2013
Messages
11
Hi,

I am struggling to get my head around the following, any help would be appreciated. I have the following list, and need to count the number of mixed sku/single sku pallets.

In this example Pallet 1 has 2 different item codes, so need to return 1 mixed pallet, and pallet 2 has only 1 item code, so expecting 1 Single Sku Pallet.

Any help would be appreciated
120965
120662
120662
220965
220965
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
With Power Query, bring data into Editor and Group by Pallet and Count Unique Rows. Here is the Mcode

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Pallet"}, {{"Count", each Table.RowCount(Table.Distinct(_)), Int64.Type}})
in
    #"Grouped Rows"

Book4
ABCDE
1PalletSKUPalletCount
212096512
312066221
4120662
5220965
6220965
Sheet1
 
Upvote 0
I have managed to solve this by adding a extra colum to assist with the pallet counts,

=SUM(--(FREQUENCY(IF(C2:C500=ROW()-1,MATCH(E2:E500,E2:E500,0)),ROW(E2:E500)-ROW(E2)+1)>0))

This returns, Pallet 1 has 2 item codes,
the next row then return Pallet 2 has only 1 item code

I have then added a simple count of 1, and greater than 1

Going to try the power query thing but i have not used this before.

Appreciate all your help
 
Upvote 0
Hi,

as an alternative option:
Book1
ABCDE
1Pallet#SKUPalletType
21209651Mixed SKU Pallet
31206622Single SKU Pallet
4120662
5220965
6220965
Sheet4
Cell Formulas
RangeFormula
D2:D3D2=INDEX(A2:A6,MATCH(0,COUNTIF(D1:D1,A2:A6),0))
E2:E3E2=IF(SUM(--(FREQUENCY(IF($A$2:$A$6=$D2,$B$2:$B$6),$B$2:$B$6)>0))>1,"Mixed SKU Pallet","Single SKU Pallet")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,684
Messages
6,126,199
Members
449,298
Latest member
Jest

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