Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Most frequent text string and sum...

Latest post Tue, Apr 20 2010 8:41 AM by kabanon. 3 replies.
  • Tue, Apr 13 2010 5:05 AM

    • kabanon
    • Top 500 Contributor
    • Joined on Tue, Apr 13 2010
    • Posts 3
    • Points 31

    Most frequent text string and sum...

    Hi all,

    i'm trying to do the following via a formula in Excel 2007 but i really do not succeed to do something .. Here is my problem:

    Column A            Column B        

    0.86%                 Chemicals

    0.78%                 Travel & leisure

    0.58%                 Insurance

    1.56%                  Banks

    7.25%                 Banks

    etc...

     

    The total of column A is 100%, 

    I want to know what is the most 4 or 5 frequent sectors, with the sum of the weight. Is this clear ?

    Many thanks in advance

    • Post Points: 21
  • Mon, Apr 19 2010 1:47 PM In reply to

    • Roger Govier
    • Top 10 Contributor
    • Joined on Wed, Jan 9 2008
    • Abergavenny, South Wales, UK
    • Posts 149
    • Points 2,288
    • MVP

    Re: Most frequent text string and sum...

    Hi

     

    Not sure that I undersatnd the question fully.

    Does the following provide what you want?

    =INDEX(A:B,MATCH(LARGE(A:A,ROW(A1)),A:A,0),2)
    Enter into any cell you wish, then copy down to the 4 cells beneath.

    Regards
    Roger Govier
    Microsoft Excel MVP

    • Post Points: 21
  • Tue, Apr 20 2010 3:35 AM In reply to

    • kabanon
    • Top 500 Contributor
    • Joined on Tue, Apr 13 2010
    • Posts 3
    • Points 31

    Re: Most frequent text string and sum...

    Hi Roger

     

    Thank you for this but what I get is partially not what I want.

    Here is what I do : each name has a defined weight individually. Accor, Air liquide, etc.. I do a sumif(range;Sector,range) tha gves me the total weight of the sector in front of each.

    When I do your formula, (yellow column), or whan i do a "LARGE" function, it gives me 3 times the 15.36% (as it appears 3 times), then 2 times 13.83..; etc

    What I would do is something that returns one time the 1st biggest value (whatever the number of times it appears) , then, the second, ..

    Is there a way to do, in an other column a IF function like    IF(this value is already in the list ; TRUE 0 ; FALSE this value) ?

    Many thanks anyway for looking at this !

    Here is what I have

    Basket Weight icb_sector_name Total Sector Weight Major Sectors
    ACCOR SA 1,48% Travel & Leisure 1,48% 15,36%
    AIR LIQUIDE SA 1,25% Chemicals 1,25% 15,36%
    ALCATEL-LUCENT 0,32% Technology Hardware & Equipmen 0,55% 13,83%
    ALSTOM 1,63% Industrial Engineering 4,45% 13,83%
    ARCELORMITTAL 1,41% Industrial Metals & Mining 1,41% 9,19%
    AXA SA 0,74% Nonlife Insurance 0,74% 7,57%
    BNP PARIBAS 3,97% Banks 7,57% 7,57%
    BOUYGUES SA 11,34% Construction & Materials 15,36% 7,57%
    CAP GEMINI 1,37% Software & Computer Services 1,37% 7,57%
    CARREFOUR SA 4,82% Food & Drug Retailers 4,82% 7,37%
    CREDIT AGRICOLE SA 2,08% Banks 7,57% 4,82%
    DANONE 7,37% Food Producers 7,37% 4,62%
    DEXIA SA 0,06% Banks 7,57% 4,45%

     

    • Post Points: 5
  • Tue, Apr 20 2010 8:41 AM In reply to

    • kabanon
    • Top 500 Contributor
    • Joined on Tue, Apr 13 2010
    • Posts 3
    • Points 31

    Re: Most frequent text string and sum...

    Ok, done, here what I did :

    =IF(COUNTIF(D2:D23;D2)>1;0;D2)

     

    then it gives me "0" if the number is already referenced and "X" if it is not

     

    Many Thanks

    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright Excel User Group and the relevant contributors, 2010. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.