Can I put a If statement before I execute my RANK?

RudeBoy

Active Member
Joined
Feb 2, 2003
Messages
376
I have a RANK Formula like this: =RANK(J12,J$9:J$728)
I am doing a Sort so if I have a Duplicate item in Column A of that same row of the Rank I do not want it to execute the RANK

So Like this if A12 is equal = to A11 Then "DUP"

How can I combine a test into the Rank Formula & do not execute it if previous line has a DUPE in Column A?

Thanks for your help
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I have a RANK Formula like this: =RANK(J12,J$9:J$728)
I am doing a Sort so if I have a Duplicate item in Column A of that same row of the Rank I do not want it to execute the RANK

So Like this if A12 is equal = to A11 Then "DUP"

How can I combine a test into the Rank Formula & do not execute it if previous line has a DUPE in Column A?

Thanks for your help
I got the Formula working but it did not re-rank after it got rid of DUP it did this - It skipped #4 that is where the DUP was
I have some Visial Basic running on that tab to auto sort rank like this for that tab:
'
rowcount = ActiveSheet.UsedRange.Rows.Count
Range(Cells(9, 1), Cells(rowcount, 22)).Select

Selection.Sort Key1:=Range("K9"), Order1:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Range("A1").Activate
End Sub

$ POS $
RANK
01
02
03
05
 
Upvote 0
I got the Formula working but it did not re-rank after it got rid of DUP it did this - It skipped #4 that is where the DUP was
I have some Visial Basic running on that tab to auto sort rank like this for that tab:
'
rowcount = ActiveSheet.UsedRange.Rows.Count
Range(Cells(9, 1), Cells(rowcount, 22)).Select

Selection.Sort Key1:=Range("K9"), Order1:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Range("A1").Activate
End Sub

$ POS $
RANK
01
02
03
05
Here is the Formula I got working but just not re-ranking after DUP gone
=IF($B12=$B11,"DUP",RANK(J12,J$9:J$728))
 
Upvote 0
Is it are you looking for?

Book1
BJK
11A16
12B25
13C34
14C4DUP
15A5DUP
16D63
17E72
18F81
Sheet1
Cell Formulas
RangeFormula
K11:K18K11=IF(COUNTIF($B$11:B11,B11)>1,"DUP",SUMPRODUCT(--($J$11:$J$18*(MATCH($B$11:$B$18,$B$11:$B$18,0)=ROW($B$11:$B$18)-MIN(ROW($B$11:$B$18))+1)>=J11)))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,331
Messages
6,124,312
Members
449,152
Latest member
PressEscape

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top