+ Reply to Thread
Results 1 to 7 of 7

consider only the 3 worst stocks?

  1. #1
    Registered User
    Join Date
    03-23-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    26

    consider only the 3 worst stocks?

    hi again,
    i have the return of some stocks and their credit rating. i want to consider only the 30 stocks with the lowest rating. the problem is that many stocks have the same rating and i dont know how to express that in excel. i was thinking the if function. for example:

    apple rating=1
    ibm rating=2
    microsoft rating=2
    alibaba rating =3
    google rating=3
    yahoo rating=4

    in this example i want to consider only the three worse stocks. these are apple, ibm, microsoft. i cant for example say if rank<4 because that will give me 5 stocks, not three.

    any ideas?

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: consider only the 3 worst stocks?

    If these were your items:

    apple rating=1
    ibm rating=1
    microsoft rating=2
    alibaba rating =2
    google rating=2
    yahoo rating=3

    Which would be the worst 3?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: consider only the 3 worst stocks?

    See if this will get you started. I used a helper column in C...
    A
    B
    C
    2
    apple
    1
    1
    3
    ibm
    2
    2
    4
    microsoft
    2
    3
    5
    alibaba
    3
    4
    6
    google
    3
    5
    7
    yahoo
    4
    6
    8
    9
    apple
    1
    10
    ibm
    2
    11
    microsoft
    3

    C2=RANK(B2,$B$2:$B$7,1)+COUNTIF(B$2:B2,B2)-1
    copied down. This will give you each stock's ranking

    Then...
    A9=INDEX($A$2:$A$7,MATCH(ROW(A1),$C$2:$C$7,0))
    B9=SMALL($C$2:$C$7,ROW(A1))
    both copied down as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-23-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    26

    Re: consider only the 3 worst stocks?

    thank you very much! i really appreciate it!

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: consider only the 3 worst stocks?

    Have you considered Tony's question - or is that not a an issue for you? It will affect the n-worst and n-1 worst stocks, with n being 3 or 30 or whatever you choose as the amount you want to see

  6. #6
    Registered User
    Join Date
    03-23-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    26

    Re: consider only the 3 worst stocks?

    hi, i just saw it. no thats not an issue for me. thanks to you and tony for your input though!

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: consider only the 3 worst stocks?

    OK cool, thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Finding the worst Offender
    By desertdude1 in forum Excel General
    Replies: 2
    Last Post: 11-30-2007, 12:16 PM
  2. [SOLVED] Stocks
    By cheryl church in forum Excel General
    Replies: 1
    Last Post: 08-11-2006, 01:20 AM
  3. best and worst outcomes
    By xela1986 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-24-2006, 06:27 PM
  4. The worst Code Ever
    By Jacob_F_Roecker in forum Excel General
    Replies: 4
    Last Post: 03-12-2006, 07:55 PM
  5. your help system is the worst of any software i've used.unable to.
    By pinkie in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 02-03-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1