COUNTIF(DISTINCT
Hello Community, I am attempting to count unique numbers in one column if the code in the other column is "X". =COUNTIF(DISTINCT([Claim Number]:[Claim Number], [Contract Type]:[Contract Type], @cell = "LW"))
Claim numbers are formatted as letter and numbers. Each part work fine separately, but not together.
What am I doing wrong
Cheers,
Peter
Best Answer
-
Here is a different approch
- Collect all the Claim number rows with contract type "LW",
COLLECT([Claim number]:[Claim number], [contract type]:[contract type], "LW")
- select only the distinct ones,
DISTINCT(...)
- count them.
COUNT(...)
=COUNT(DISTINCT(COLLECT([Claim number]:[Claim number], [contract type]:[contract type], "LW")))
Answers
-
Distinct seems to only take one range as parameter.
Break it in 2
=COUNTIF(DISTINCT([Claim Number]:[Claim Number]), @cell = "LW")+COUNTIF(DISTINCT( [Contract Type]:[Contract Type]), @cell = "LW")
-
Hi Christian,
First, thank you!
I only need one column to be distinct [claim number] which is the one I want to count, if the other column meets the criteria [contract type] is "LW".
Peter
-
Here is a different approch
- Collect all the Claim number rows with contract type "LW",
COLLECT([Claim number]:[Claim number], [contract type]:[contract type], "LW")
- select only the distinct ones,
DISTINCT(...)
- count them.
COUNT(...)
=COUNT(DISTINCT(COLLECT([Claim number]:[Claim number], [contract type]:[contract type], "LW")))
-
Brilliant!!! It worked. Much appreciated. You made my day!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 138 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!