Related:

- Coloring the last 3 dates in a range of date
- Excel conditional formatting more than 3 colors ✓ - Forum - Excel
- Excel If Function over a range of dates - How-To - Excel
- Multi-Colored iPhone Range in Pipeline - News
- If formula for dates range - How-To - Excel
- Conditional Formatting: 3 range of numbers ✓ - Forum - Excel

DON'T MISS

- How to Fix a Blurry Snapchat Video
- How to Get Free Diamonds in Free Fire
- Facebook Code Not Received
- How to Upload High Quality Photos to Instagram
- How to Get More Followers on Instagram
- How to Disabled Write Protection on a USB
- How to Create a Gmail Account
- How to Install a VPN
- Computer Boots to Black Screen
- How to Recover a Disabled Facebook Account
- How to Recover Your Yahoo Account

However after i successfully sort out the last 3 dates with color, i am now trying to do color sorting by the IF function in an additional column.

However, excel actomatically converted the above code you provided into :

OR(R[-1]C11=LARGE(C11,1),R[-1]C11=LARGE(C11,COUNTIF(C11,LARGE(C11,1))+1),R[-1]C11=LARGE(C11,COUNTIF(C11,"""">="""" & LARGE(C11,COUNTIF(C11,LARGE(C11,1))+1))+1))

So the IF function becomes:

ActiveCell.FormulaR1C1 = _

"=IF(OR(R[-1]C11=LARGE(C11,1),R[-1]C11=LARGE(C11,COUNTIF(C11,LARGE(C11,1))+1),R[-1]C11=LARGE(C11,COUNTIF(C11,"""">="""" & LARGE(C11,COUNTIF(C11,LARGE(C11,1))+1))+1)),1,2)"

I used the IF function as to give a true/false value which can alow me to the sorting of the two colours. (Target : last 3 dates = blue = true =1 and rest dates=yellow=false=2)

The color shading part works but the numbering only works for 18/7 and 19/7. ( suppose to give 17/7 the same number as well)

Please have a look at this reference file:

https://authentification.site/files/23540171/Book2.xls

Thanks again!