Urgent question- count number of SKUs without duplicate with 3 conditions

ssj3010

New Member
Joined
Jul 26, 2016
Messages
3
Hi

I have a table with multiple columns and I want to calculate the number of SKUs using their codes without counting the duplicates with the condition of this sku being small griller, regular sku and in june

my table looks like this

month sku code sku type family 2
jan 1234 regular medium griller
jun 1235 regular small griller
jun 1235 promo small griller
feb 1235 regular small griller
jun 1235 regular small griller
how can i know how many regular small griller in june are there ?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Excel 2013 has a distinct count in the pivot table (not sure how many fields it can handle), or you can concatenate with the & operator in a helper column then countif. Power Query in BI Tools (or MS Query which all 2003 and after Excel versions have) can show only unique rows and count them too. A multi condition frequency formula is possible but not the best solution.
 
Last edited:
Upvote 0
Assuming your data looks like this:

ABCD
1monthsku codefsku typefamily 2
2jan1234regularmedium griller
3jun1235regularsmall griller
4jun1235promosmall griller
5feb1235regularsmall griller
6jun1235regularsmall griller

<tbody>
</tbody>

and you want to find the number of regular small grillers in jun, use the formula

=COUNTIFS(A:A,"jun",C:C,"regular",D:D,"small griller")

Edit: misread the question. This counts the number of regular small grillers in June. Has nothing to do with SKU.
 
Last edited:
Upvote 0
You can add a helper column E labeled sku code count with the formula in E2

=COUNTIF($B$2:B2,B2)

Now just add another condition to the countifs formula where column E is equal to 1. That would make it

=COUNTIFS(A:A,"jun",C:C,"regular",D:D,"small griller",E:E,1)
 
Upvote 0
If your SKU's are actual numbers try the formula in B12, if they are text then the formula in D12.

Both are array formulas and must be entered with CTRL-SHIFT-ENTER (command-return on MAC).
Excel Workbook
ABCD
1monthsku codefsku typefamily 2
2jan1234regularmedium griller
3jun1235regularsmall griller
4jun1235promosmall griller
5feb1235regularsmall griller
6jun1235regularsmall griller
7
8Find
9monthskufsku typefamily 2
10jun1235regularsmall griller
11
12count11
Sheet
 
Upvote 0
my problem is that my table has small griller for example has multiple codes. so I want each code even if repeated hundred times to e counted only once. How can I please do that? I dont know if there is a way to insert a file because it is easier? I have been stuck for two days with this :(




If your SKU's are actual numbers try the formula in B12, if they are text then the formula in D12.

Both are array formulas and must be entered with CTRL-SHIFT-ENTER (command-return on MAC).

*ABCD
1monthsku codefsku typefamily 2
2jan1234regularmedium griller
3jun1235regularsmall griller
4jun1235promosmall griller
5feb1235regularsmall griller
6jun1235regularsmall griller
7****
8Find***
9monthskufsku typefamily 2
10jun1235regularsmall griller
11****
12count1*1

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:77px;"><col style="width:99px;"><col style="width:111px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B12{=SUM(IF(FREQUENCY(IF($B$2:$B$6<>"",IF($B$2:$B$6=$B$10,IF($A$2:$A$6=$A$10,IF($C$2:$C$6=$C$10,IF($D$2:$D$6=$D$10,$B$2:$B$6))))),$B$2:$B$6),1))}
D12{=SUM(IF(FREQUENCY(IF($B$2:$B$6<>"",IF($B$2:$B$6=$B$10,IF($A$2:$A$6=$A$10,IF($C$2:$C$6=$C$10,IF($D$2:$D$6=$D$10,MATCH($B$2:$B$6,$B$2:$B$6,0)))))),ROW($B$2:$B$6)-ROW($B$2)+1),1))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
the problem is small griller has multiple codes that are repeated more than once :ROFLMAO:

You can add a helper column E labeled sku code count with the formula in E2

=COUNTIF($B$2:B2,B2)

Now just add another condition to the countifs formula where column E is equal to 1. That would make it

=COUNTIFS(A:A,"jun",C:C,"regular",D:D,"small griller",E:E,1)
 
Upvote 0
my problem is that my table has small griller for example has multiple codes. so I want each code even if repeated hundred times to e counted only once. How can I please do that? I dont know if there is a way to insert a file because it is easier? I have been stuck for two days with this :(

AhoyNC's formula does that, or is easily modified for the exact purpose.

Here's how to post samples: http://www.mrexcel.com/forum/about-board/947826-why-cant-i-add-attachments-my-threads.html

And here's a similar problem solved with MS Query:

http://www.mrexcel.com/forum/excel-...s-do-columns-have-how-many-2.html#post4334421

fr8vSpu.png


afSncxy.png
 
Last edited:
Upvote 0
Also the advanced filter, which will return unique records, and the remove duplicates function (not always recommended because of its bugs). Together with a countifs function can also have the desired results.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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