Logical function in excel 2013