Excel: Ranking multiple columns of TEXT data

Situation

I have two text columns: 'Group' and 'Colours' like below and I want to use a formula to generate a 'Rank' that restarts numbering with each different group

Group - Colour - Rank
A - Red - 1
A - Red - 1
A - Blue - 2
A - Blue - 2
A - Green - 3
B - Purple - 1
B - Purple - 1
B - Yellow - 2
B - Pink - 2
C - Orange - 1
C - Blue - 1

I have tried various different formula using both SUMPRODUCT and RANK.EQ but I have not been able to produce a working formula because both columns are TEXT.

RANK.EQ fails if I pass an array (conditional evaluated) as the 2nd argument so I can't use that. It only can't use that and only appears to accept a range object - not an array of values.

I have used INDEX with no rows or columns specified to return an array to avoid entering the formula as an array CSE formula.

Question

How can I use RANK.EQ or SUMPRODUCT to produce the results in a simple formula ? Any suggestions welcomed
LVL 3
AL_XResearchAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

ProfessorJimJamMicrosoft Excel ExpertCommented:
you can simply use COUNTIFS to rank them.
Rgonzo1971Commented:
Hi,

pls try in C2

=IF(A4<>A3,-D3,0)+IF(AND(A4=A3,B4=B3),D3+0,D3+1)

Open in new window

Regards
AL_XResearchAuthor Commented:
ProfessorJimJam: Please provide an example as on the face of it COUNTIFS will 'count' multiple matches not 'rank' different matches - as shown in my example.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

AL_XResearchAuthor Commented:
Rgonzo1971: Sorry but that only produces '1' for the first row with a unique combination of colour and group. I am also not sure what column D has to do with this - unless there is an extra step you forgot to mention :)
Rgonzo1971Commented:
Corrected Formula in C2

=+IF(A2<>A1,-C1,0)+IF(AND(A2=A1,B2=B1),C1,C1+1)

Open in new window


EDIT Herewith an example
EE20151117.xlsm

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
AL_XResearchAuthor Commented:
Rgonzo1971: That looks good. A lesson not to get to caught up with a specific function

HOWEVER

I would still be interested if someone can advise how to get the 'Rannk.eq' function to work for my issue because this will provide a more robust solution. The two columns of text data are no GUARENTEED to be sorted and I would still rank of the colour within a group even if the colours in the group were randomly distributed e.g.

A - Red - 1
A - Blue - 2
A - Green - 3
A - Blue - 2
A - White - 4
A - Red  - 1
ProfessorJimJamMicrosoft Excel ExpertCommented:
personally, i do not believe you can do this with Rank.eq function. i think Rgonzo formula does a great job for this purpose
AL_XResearchAuthor Commented:
Yes the formula from 'Rgonzo' is exactly what I needed !

The 'Rank.eq' function should be able to do this as it is what the function is supposed to be for !
AL_XResearchAuthor Commented:
Simplest is always best !
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.