Need to Count Distinct Based on Multiple Criteria
Hi there!
I have a database (Sheet 1) where I log all my company's gifting to social media influencers and the subsequent exposure on Social Media in one sheet. I organize them by the Name of Influencer, the month we gifted, the month they posted (if they did, otherwise its blank), among others.
In a different sheet (Sheet 2), I am trying to count distinct the Name of the influencer we gifted from (Sheet 1). But I want it to be interactive so within Sheet 2, I have a multiple dropdown cell I will list all the months I am interested in evaluating. For example, if I wanted to see the distinct count of names that we gifted in January, February, and March I would select those three months in that dropdown menu.
I am able to to the distinct count without any problems when it is just one month to evaluate but when it becomes multiple values, the formula below does not work.
=COUNT(DISTINCT(COLLECT({DD Influencer Database Range 1}, {DD Influencer Database Range 2}, Joined@row)))
Any solutions to this?
Thank you!
Best Answer
-
Hi @Amt501
I fixed as you need by using multiselect option, please check it:
=IFERROR(COUNT(DISTINCT(COLLECT({Name}, {Gifts Sent}, OR(@cell = Joined4, @cell = Joined5, @cell = Joined6, @cell = Joined7, @cell = Joined8, @cell = Joined9, @cell = Joined10, @cell = Joined11, @cell = Joined12, @cell = Joined13, @cell = Joined14, @cell = Joined15)))), "")
the following screenshot shows the result
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
Answers
-
Hi @Amt501
Hope you are fine, please try the following formula ( i chose Jan,Feb,Mar) as a criteria:
=COUNT(DISTINCT(COLLECT({DD Influencer Database Range 1}, {DD Influencer Database Range 2}, OR(CONTAINS("Jan", @cell), CONTAINS("Feb", @cell), CONTAINS("Mar", @cell)))))
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
Hi @Bassam Khalil ,
Thank you for your comments!
However, I was wondering if there can be a solution where " Jan" , " Feb" , and "Mar" are not inputs into a formula.
That is, I want the formula to reference a dropdown list to see which months to include. So when that dropdown changes months to Mar, Apr, May the formula updates automatically.
Is that possible?
Thank you!
-
Yes we can do that, if you like me to fix the formula directly on your sheet please share me as an admin on a sample copy of your sheets ( Source & Destination ) and i will Create the exact formula for you then you can copy it to your original sheet.
My Email for sharing : Bassam.k@mobilproject.it
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
@Bassam Khalil I Have created a new workspace and invited you as admin to the space.
Thank you for your help!
-
Ok i will check it .
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
Hi @Amt501
I fixed as you need by using multiselect option, please check it:
=IFERROR(COUNT(DISTINCT(COLLECT({Name}, {Gifts Sent}, OR(@cell = Joined4, @cell = Joined5, @cell = Joined6, @cell = Joined7, @cell = Joined8, @cell = Joined9, @cell = Joined10, @cell = Joined11, @cell = Joined12, @cell = Joined13, @cell = Joined14, @cell = Joined15)))), "")
the following screenshot shows the result
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
@Bassam Khalil Thank you very much. This works perfectly!!
-
Thank you!
-
You are welcome and I will be happy to help you any time
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
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!