Formula

But using the Max(Abs(.... returns the positive value of the largest integer? Actually it returned the wrong integer in my sheet.