subtotal unique values when filtering a list

shredr

New Member
Joined
Jan 23, 2007
Messages
5
This is something I would figure is simple in Excel but have yet to figure it out...and I've been trying on and off for a while.

I have a sheet with daily shipments for my company, it's about 10000 lines deep per year.

I applied the data filter to the sheet, and have a couple subtotal functions working, but I cannot figure out how to get a count of unique values when I am filtering.

I've tried different combinations of sum,subtotal and/or countif functions, but I am dead ending with everything.
Looking at various forums I haven't found anything that solves my issue.

I need the unique count of sales orders shown in column A when I apply the filter.
We may ship partials against an order line, so I don't want to keep counting the same line if we ship four times a month against it. (does that make sense?)

Am I making my life too difficult with this?

Thanks for ANY help with this one.
Ted

This is a portion of my sheet.
I threw in some dummy dates to shorten it up and left a couple examples of things I tried at the top of column C



Excel 2010
ABCDEFGH
1022SUM(IF(FREQUENCY(IF(LEN(A6:A10196)>0,MATCH(A6:A10196,A6:A10196,0),""), IF(LEN(A6:A10196)>0,MATCH(A6:A10196,A6:A10196,0),""))>0,1))count of shipments22
2#REF!SUM(IF(FREQUENCY(IF(LEN(A2:A10)>0,MATCH(A2:A10,A2:A10,0),""), IF(LEN(A2:A10)>0,MATCH(A2:A10,A2:A10,0),""))>0,1))qty parts shipped4,580
3SUM(IF(FREQUENCY(A2:A10,A2:A10)>0,1))
4
5SO #itemdatequantitysellum
655474-2002-0602-5001/02/131200EA
755474-5002-0605-4901/02/13150EA
855474-6002-0616-5001/02/13120EA
955474-3002-0623-5001/02/13100EA
1055525-2002-0700-4901/02/1310EA
1155169-1002-0782-5002/02/13120EA
1255170-1002-0782-9J02/03/13450EA
1355219-1002-0785-9J02/04/13175EA
1455077-1002-0796-9J02/05/1330EA
1555172-1002-0871-9J02/06/1330EA
1655308-1002-0955-5002/07/1375EA
1755305-1002-1075-9J02/08/13600EA
1855165-1002-1076-5003/02/13175EA
1955220-1002-1076-9J03/03/13450EA
2055332-1002-1078-9J03/04/13250EA
2155309-1002-1115-5003/05/13100EA
2255472-8002-1293-6B03/06/1325EA
2355213-1002-1336-9J03/07/1385EA
2455474-4002-1377-5003/08/13400EA
2555412-3002-1404-4903/09/1315EA
2655260-6002-1459-6B03/10/1312EA
2755338-4002-1474-6B03/11/138EA
test
Cell Formulas
RangeFormula
A1=SUM(IF(FREQUENCY(A6:A27,A6:A27)>0,1))
A2=SUBTOTAL(2,IF(FREQUENCY(#REF!,#REF!)>0,1))
H1=SUBTOTAL(2,D6:D27)
H2=SUBTOTAL(9,D6:D27)
B1{=SUM(IF(FREQUENCY(IF(LEN(A6:A27)>0,MATCH(A6:A27,A6:A27,0),""), IF(LEN(A6:A27)>0,MATCH(A6:A27,A6:A27,0),""))>0,1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A6,ROW(A6:A27)-ROW(A6),,1)),
  IF(A6:A27<>"",MATCH("~"&A6:A27,A6:A27&"",0))),ROW(A6:A27)-ROW(A6)+1),1))

If the relevant entries are not surrounded with special meaning chars like <, the "~"& and &"" bits can be omitted.
 
Upvote 0
Aladin:
I would buy you several beers for this if you were here, thank you! Works perfectly!
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,540
Members
449,038
Latest member
Guest1337

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