Rank based on 2 Dates(May 1st to 30 April)

aravindhan_31

Well-known Member
Joined
Apr 11, 2006
Messages
672
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi,
Hope you are all having a wonderful day. I need some help to rank 1,2,3 etc based on criteria.
I have the date of leaving in column A & I want to rank them based on the oldest to the newest, however
1 . I need to rank unique number 1,2,3 if the date of leaving is same ( I was able to get that via this formula =RANK(A2,$A$2:$A$24,1)+COUNTIF($A$2:A2,A2)-1),
but I want to use this condition only for a particular date range . The academic year starts always from 1st May to April 30 of a year, I want to rank all date of leaving within that period. example
If have date of 10 date of leaving within 1 May 2019 till 30 Apr 20, then 1 to 10 to be ranked, and if any other date after April-2020 that is 01-May-2020, then again the ranking should start from 1 again.
The start date and end date is not there in the file, hence to be added in formula ( always 1May to 30 April) and date of leaving column is not sorted

I am not able to add using Xl2BB, hence posting image.

1647577537926.png


Thanks for the help in advance
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Book2
ABCDE
1
226/12/201501/05/201530/04/20161
326/12/201501/05/201530/04/20162
426/12/201501/05/201530/04/20163
526/12/201501/05/201530/04/20164
602/11/201801/05/201830/04/20181
703/05/201901/05/201930/04/20191
806/06/201901/05/201930/04/20192
908/06/201901/05/201930/04/20193
1013/06/201901/05/201930/04/20194
Sheet1
Cell Formulas
RangeFormula
E2:E10E2=SUMPRODUCT(($A$2:$A$10+ROW($A$2:$A$10)*10^-2<=A2+ROW()*10^-2)*($B$2:$B$10=B2)*($C$2:$C$10=C2))
 
Upvote 0
Book2
ABCDE
1
226/12/201501/05/201530/04/20161
326/12/201501/05/201530/04/20162
426/12/201501/05/201530/04/20163
526/12/201501/05/201530/04/20164
602/11/201801/05/201830/04/20181
703/05/201901/05/201930/04/20191
806/06/201901/05/201930/04/20192
908/06/201901/05/201930/04/20193
1013/06/201901/05/201930/04/20194
Sheet1
Cell Formulas
RangeFormula
E2:E10E2=SUMPRODUCT(($A$2:$A$10+ROW($A$2:$A$10)*10^-2<=A2+ROW()*10^-2)*($B$2:$B$10=B2)*($C$2:$C$10=C2))
Hi Bebo,

Thanks a lot this one worked and super excited now.
quick check:
In this we are using helper columns to identify start date and end date for each of those dates. is there a way we can do this within the formula, so that I don't have to add those 2 columns

Thanks again :)
 
Upvote 0
Try

Book1
AB
1
212/26/20151
312/26/20152
412/26/20153
512/26/20154
611/02/20181
705/03/20191
806/06/20192
904/01/20203
1004/08/20204
1104/15/20205
1204/22/20206
1304/29/20207
1406/15/20201
1509/13/20202
1612/12/20203
1703/12/20214
1806/10/20211
1909/08/20212
2012/07/20213
2103/07/20224
2206/05/20221
2309/03/20222
2412/02/20223
2512/02/20224
Sheet1
Cell Formulas
RangeFormula
B2:B25B2=COUNTIFS($A$2:$A$24,"<"&A2,$A$2:$A$24,">="&DATE(YEAR(A2)-(MONTH(A2)<5),5,1))+COUNTIF($A$2:A2,A2)
 
Upvote 0
Solution
Try

Book1
AB
1
212/26/20151
312/26/20152
412/26/20153
512/26/20154
611/02/20181
705/03/20191
806/06/20192
904/01/20203
1004/08/20204
1104/15/20205
1204/22/20206
1304/29/20207
1406/15/20201
1509/13/20202
1612/12/20203
1703/12/20214
1806/10/20211
1909/08/20212
2012/07/20213
2103/07/20224
2206/05/20221
2309/03/20222
2412/02/20223
2512/02/20224
Sheet1
Cell Formulas
RangeFormula
B2:B25B2=COUNTIFS($A$2:$A$24,"<"&A2,$A$2:$A$24,">="&DATE(YEAR(A2)-(MONTH(A2)<5),5,1))+COUNTIF($A$2:A2,A2)
This one as well worked.. thank you so much.............
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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