I don't think if there is any way to filter data using formula only. Can do easily with the help of macro.