I'm not sure you'd want to reset above 24 down to 0 - aren't we working on numbers of hours, not clock times?
But if you were working on times and wanted to combine separate hour and minute readings into the nearest hour, then I'd go for
Code:
=ROUND(MOD(((A1*60)+B1)/60,24),0)
But like I said - I don't think the OP is after that.