+ Reply to Thread
Results 1 to 3 of 3

Ranking with N/A values

  1. #1
    Registered User
    Join Date
    11-22-2012
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Ranking with N/A values

    Hello,

    For my paper I'm trying to calculate the rank of stock returns over a 262 day period. For most of my returns this is no problem and can be computed using the regular RANK function. However, some companies don't have 262 returns over this period, which causes the formula to stop working due to the #N/A values. It would be great if you guys can create a formula that ranks the returns that the company does have over this period (i.e. if the company has 150 returns over the 262 day period, just rank these from 1 to 150). I tried adapting the formula myself, but that didn't realy work out.

    Thanks in advance!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Ranking with N/A values

    Try using COUNTIF to rank as that function can ignore #N/A values in the data, e.g. with data to rank in A2:A263 try this formula in B2 copied down

    =IF(ISNA(A2),"",COUNTIF(A$2:A$263,">"&A2)+1)

    ranks highest value 1 - change > to < to rank lowest value 1
    Audere est facere

  3. #3
    Registered User
    Join Date
    11-22-2012
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Ranking with N/A values

    Works perfectly, this was exactly what I was looking for. Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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