=DATEDIF(A1,B1,"m")-(DAY(A

Boolean expressions like (DAY(A1)>1) return TRUE if the day of the month is larger than 1, and FALSE otherwise. If you use Boolean expressions in an arithmetic expression (like the suggested formula), the TRUE values are converted to 1 and the FALSE to 0.

For more on DATEDIF, see Chip Pearson's webpage at http://www.cpearson.com/ex