mercredi 28 mars 2018

RANK IF formula on Google Sheets with SUM

I am trying to create a ranking of summed numbers out of a database. The Database has a list of individual offices of companies in certain countries (numbered 1-10). In some cases, the same company is in multiple countries. Countries are listed in Column A; Companies are in column B; Offices are in column C.

Each individual office has a score. Office scores are in column D of the database.

I would like to create a rank of companies based on the company's total score per country. The company's total score per country is the sum of scores of all offices of the same company in the same country.

In order to build such a ranking one would have to:

1 - Get the company's total score per country. I have done this using a SUMIFS function. This is the function I've used to calculate this score: =SUMIFS($D$2:$D, $A$2:$A, $A2, $B$2:$B, $B2)

2- Rank it against the list of other companies' total score per country only for those companies that are in the same country.

I am having trouble defining the range for the RANK and have learnt that this is not possible to do using a function like this. The range against which to rank the value calculated on step 1 needs to be a conditional sum as well - the sum of all scores in the country of the office we are ranking. How can this be done?

After doing some research, I have tried solutions involving SUMPRODUCT and COUNTIFS but have failed to achieved the desired result. How can I do this?

I have created a sample sheet here that might help to understand the problem here.

Thank you

Aucun commentaire:

Enregistrer un commentaire