VBA? dates rank? possible?

rsj88

New Member
Joined
Feb 20, 2018
Messages
38
Need a Vba code to obtain the rank for the latest date and car type.

EG find the latest date from today() for each car then obtain a rank. if the car changes the rank starts from 1 again. so In theory the latest 25 dates for each car.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Car[/TD]
[TD]Date[/TD]
[TD]Rank[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Volvo[/TD]
[TD]01/01/2018[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]volvo[/TD]
[TD]04/02/2018[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]audi[/TD]
[TD]04/03/2018[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bmw[/TD]
[TD]20/02/2018[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
so In theory the latest 25 dates for each car.

Hi, not sure what that means - but maybe you could try this.


Excel 2013/2016
ABC
1CarDateRank
2Volvo01/01/20182
3volvo04/02/20181
4audi04/03/20181
5bmw20/02/20181
Sheet1
Cell Formulas
RangeFormula
C2=1+COUNTIFS($A$2:$A$5,A2,$B$2:$B$5,">"&B2)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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