buffalofan19
New Member
- Joined
- Jun 26, 2009
- Messages
- 33
I have a spreadsheet with the following data type
Order # Date Price
AA 9/15/2014 110
AB 9/15/2014 110
AC 9/16/2014 125
AD 9/17/2014 120
AE 9/16/2014 120
What I am trying to do is rank each transaction first by the earliest date, then by the lowest price, and then, if there is still a tie by order number. The rank of the order number isn't really that important, but I just need a final tie break, and I figured alphabetically was the best way.
I know I can rank date and price with the following: =COUNTIF($B$2:$B$6,"<"&B2)+1+SUMPRODUCT(($B$2:$B$6=B2)*($C$2:$C$6>C2)*(A2>$A$2:$A$6)), but that would leave a tie in some transactions. For instance, Order #'s AA & AB, would both come up as "1", then AE would come up as "3", AC as "4", and AD as "5". What I need is for AB to come up as "2".
I also know I can rank the text based on alphabetical order with the following formula: =SUMPRODUCT((A2>$A$2:$A$6)+0)+1
However, I just can't seem to combine the two correctly.
Order # Date Price
AA 9/15/2014 110
AB 9/15/2014 110
AC 9/16/2014 125
AD 9/17/2014 120
AE 9/16/2014 120
What I am trying to do is rank each transaction first by the earliest date, then by the lowest price, and then, if there is still a tie by order number. The rank of the order number isn't really that important, but I just need a final tie break, and I figured alphabetically was the best way.
I know I can rank date and price with the following: =COUNTIF($B$2:$B$6,"<"&B2)+1+SUMPRODUCT(($B$2:$B$6=B2)*($C$2:$C$6>C2)*(A2>$A$2:$A$6)), but that would leave a tie in some transactions. For instance, Order #'s AA & AB, would both come up as "1", then AE would come up as "3", AC as "4", and AD as "5". What I need is for AB to come up as "2".
I also know I can rank the text based on alphabetical order with the following formula: =SUMPRODUCT((A2>$A$2:$A$6)+0)+1
However, I just can't seem to combine the two correctly.