+ Reply to Thread
Results 1 to 6 of 6

RANK formula won't work when copied from PowerPivot

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2010
    Posts
    30

    RANK formula won't work when copied from PowerPivot

    Let me set this up. I originally had this in a PowerPivot window and it works great, but my formula is crapping out now when I use it on a standard worksheet.
    I have two columns. One is titled "A or B". Two is titled "Amount".
    Example would be...

    A or B Amount
    A $100
    A $1
    B $250
    A $0
    B $25
    B $50

    I need a 3rd column to rank each within A or B now. For example row 3 and row 1 would both be ranked "1". Because they are the highest value for A and B.


    A or B Amount Rank
    A $100 1
    A $1 2
    B $250 1
    A $0 3
    B $25 3
    B $50 2

    My current formula for the "Rank" column is this...

    "=COUNTROWS(FILTER('AllData','AllData'[AOrB]=EARLIER('AllData'[AOrB]) && 'AllData'[AMOUNT]>= EARLIER('AllData'[AMOUNT])))"

    This is exactly what I needed in PowerPivot but now I need the same thing in a standard excel formula.
    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: RANK formula won't work when copied from PowerPivot

    Try this...

    Data Range
    A
    B
    C
    1
    Item
    Value
    Rank
    2
    A
    $100
    1
    3
    A
    $1
    2
    4
    B
    $250
    1
    5
    A
    $0
    3
    6
    B
    $25
    3
    7
    B
    $50
    2

    This formula entered in C2 and copied down:

    =SUMPRODUCT(--(A$2:A$7=A2),--(B2<B$2:B$7))+1
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-31-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: RANK formula won't work when copied from PowerPivot

    =SUMPRODUCT(--(A$2:A$7=A2),--(B2<B$2:B$7))+1

    Would that be something like "=SUMPRODUCT(--([Item]="A"),--(B2<[Value]))+1 " ?

    This has to be for a table that will grow continuously. I'm not really sure what to substitute in for B2.

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

    Re: RANK formula won't work when copied from PowerPivot

    With the data in this range:

    Data Range
    A
    B
    C
    1
    Item
    Value
    Rank
    2
    A
    $100
    1
    3
    A
    $1
    2
    4
    B
    $250
    1
    5
    A
    $0
    3
    6
    B
    $25
    3
    7
    B
    $50
    2

    This formula entered in C2 and copied down:

    =SUMPRODUCT(--([Item]=[@Item]),--([@Value]<[Value]))+1

  5. #5
    Registered User
    Join Date
    05-31-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: RANK formula won't work when copied from PowerPivot

    Perfect tony!

    Thanks so much

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

    Re: RANK formula won't work when copied from PowerPivot

    You're welcome. 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. formula copied or updated does now work! (sum if in this case)
    By joe pt in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-28-2013, 11:12 AM
  2. Replies: 0
    Last Post: 11-20-2012, 05:34 AM
  3. [SOLVED] RANK.EQ copied vertically through multiple events - is it possible?
    By Sam Sung in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-11-2012, 03:59 AM
  4. Formula to Rank and populate values base don Rank
    By Excel Dumbo in forum Excel General
    Replies: 3
    Last Post: 10-09-2012, 02:02 AM
  5. Does Correl/Rank combo work eg CORREL(cols E & H) where E&H=RANK(.
    By Emmanuel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2005, 11:40 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