Yesterday I made this formula for someone looking a little tricky. but a simple step to make a efficient formula can be achieve with the help of practice try some shorter formulas first then try to achieve the result through some other functions. you will learn the usage of formulas and soon you will develop them without any help. first try to get the logic behind the formula.
For example : Try to get nearest value in a range as per your requirement.
=IF($K$3="ABB",IF(INDEX(A1:A195,MATCH(MIN(ABS($B$2 :$B$195-M12)),ABS($B$2:$B$195-M12),0),0)<K12,"Minimum date is "&TEXT(K12,"dd-mm-yy"),INDEX(A1:A195,MATCH(MIN(ABS($B$2:$B$195-M12)),ABS($B$2:$B$195-M12),0),0))+1,IF(INDEX(A1:A195,MATCH(MIN(ABS($C$2: $C$195-M12)),ABS($C$2:$C$195-M12),0),0)<K12,"Minimum date is "&TEXT(K12,"dd-mm-yy"),INDEX(A1:A195,MATCH(MIN(ABS($C$2:$C$195-M12)),ABS($C$2:$C$195-M12),0),0)+1))
Regards,
Mandeep Baluja
LearningZmyPassion
https://www.linkedin.com/profile/view?id=312532939
https://www.facebook.com/VBAEXCELSQL?ref=hl