I have a date frame with two columns in the date format and I need to compare if one of them is between the interval of one more day or less than another column. For example: Column A = 2015-03-02 Column B = 2015-03-01 Comparation: If Column A == Column B: Return 'Column A within range' Elif (Column B - 1) == Column A: Return 'Column within range' Elif (Column B + 1) == Column A: Return 'Column A within range' Else: Return 'Column A OFF the accepted range'