Count Distinct Values after Filter

rrlee123

New Member
Joined
Aug 23, 2019
Messages
2
Hello, I can usually find what I need to write complex formulas, usually on this forum, but this one has had me stumped for quite some time.

I have data contained in a Table (Table1) with named ranges and need to count distinct document numbers where it does or doesn't meet certain criteria. I've been able to construct this formula to count the document numbers where it meets 4 different criteria COUNTA(FILTER(T1_RefDoc_Num,(T1_Ref_Doc_Type="CC")+(T1_Ref_Doc_Type="CL")+(T1_Ref_Doc_Type="CR")+(T1_Ref_Doc_Type="CP"))). This gets me a count, but I need to count the distinct document numbers that appear several times in the data as well as exclude GL data not equal to 131000.15.

Basically, I need to count all distinct document numbers where the document type (T1_Ref_Doc_Type) is either CC, CL, CR or CP but doesn't belong to General Ledger number 131000.15 (T1_GL) and then count the distinct documents that are returned. I don't see how to upload a file, but have paired down the data significantly, if someone would be willing to take a look.

Thank you,
Rusty
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Maybe
Excel Formula:
rows(unique(FILTER(T1_RefDoc_Num,((T1_Ref_Doc_Type="CC")+(T1_Ref_Doc_Type="CL")+(T1_Ref_Doc_Type="CR")+(T1_Ref_Doc_Type="CP"))*(T1_GL<>131000.15))))
The 31000.15 may need to go in quotes.
 
Upvote 0
Solution
rows(unique(FILTER(T1_RefDoc_Num,((T1_Ref_Doc_Type="CC")+(T1_Ref_Doc_Type="CL")+(T1_Ref_Doc_Type="CR")+(T1_Ref_Doc_Type="CP"))*(T1_GL<>131000.15))))
Thank you so much this worked!! I didn't think to even use ROWS...but I did get the 131000.15 using the * to work. I can't thank you enough!!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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