Excel count unique values from column, based on criteria from another


I'm using
=SUM(N(FREQUENCY(C2:C25,C2:C25)>0))
to get a total of the unique values in the range, but I also want to narrow it down a bit more.

I only want the total of unique values based on criteria from another column.

For example:
=COUNTIF(V2:V25,"sometext")

How can I combine these formulas?

Thanks!
TelMacoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cyberkiwiCommented:
=SUM(N(FREQUENCY(C2:C25,C2:C25*(V2:V25="sometext"))>0))
0
cyberkiwiCommented:
That didn't work, due to blanks in V2:V25 interfering and adding 1 to the total

This works

=SUM(N(FREQUENCY(C2:C25*(V2:V25="sometext"),C2:C25*(V2:V25="sometext"))>0))-(COUNTIF(V2:V25,"")<>ROWS(V2:V25))
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TelMacoAuthor Commented:
hehe, can we make this more complicated -  Is is possible to do this evaluation twice and combine again?

=SUM(N(FREQUENCY(C2:C25*(V2:V25="sometext"),C2:C25*(V2:V25="sometext"))>0))-(COUNTIF(V2:V25,"")<>ROWS(V2:V25))

=SUM(N(FREQUENCY(C2:C25*(U2:U25="othertext"),C2:C25*(U2:U25="othertext"))>0))-(COUNTIF(U2:U25,"")<>ROWS(U2:U25))

I don't want to add them, as some of the unique values will overlap
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

cyberkiwiCommented:
Twice? You mean V has to be sometext and U has to be othertext?
0
TelMacoAuthor Commented:
On second thought, I'll post this as a new question and update with a link to the new post
0
TelMacoAuthor Commented:
oh lol you're online! we posted at the same time.  Want me to do a new post, or keep this going?  

Yeah, it would based on two sets of data.  I 'd like a unique count from C where V is sometext, and U is othertext
0
cyberkiwiCommented:
Let's see which is faster.. :)
0
cyberkiwiCommented:
Try this

=SUM(N(FREQUENCY(C2:C25*(V2:V25="sometext")*(U2:U25="othertext"),C2:C25*(V2:V25="sometext")*(U2:U25="othertext"))>0))-(OR(COUNTIF(V2:V25,"*")<>ROWS(V2:V25),COUNTIF(U2:U25,"*")<>ROWS(V2:V25)))
0
TelMacoAuthor Commented:
I saw your reply prior to submitting another question, your suggestion works great.  I appreciate your help!
0
cyberkiwiCommented:
Hi TelMaco,

I double checked and there were some cases where my formula returns the incorrect result.

the correct formula should be

=SUMPRODUCT((U2:U25="sometext")*(V2:V25="othertext")*(C2:C25<>"")/COUNTIFS(U2:U25,U2:U25&"",V2:V25,V2:V25&"",C2:C25,C2:C25&""))

As given by Barry in http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_26926181.html#a35287823

Regards
0
TelMacoAuthor Commented:
Just coming back to post an update...I noticed some issues too.  Thanks for following up, I'll check out the new formula.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.