I don't know what isn't working for you. As DerbyDad03 said, the formula looks fine and works.
I wonder if the date input in cells A1 and B1were not recognized by Excel as dates.
When you enter data into a cell Excel tests it to see if it is a date. If Excel doesn't recognize the input as a date, it displays it just as you entered it.
If it recognizes the entry as a date it converts the information to a number which is stored and which will be used for your comparison, but it displays the information in a date format.
To test if A1 and B1 contain real date information, try formatting each cell with different date formats - Format - Cells - Number Tab. Select different Date formats. If the cell does not change to match the different formats you select, Excel has not recognized the entry as a date, and you are comparing two pieces of text!
If this is the case try re-entering the dates as 01-Jan-2009 for example, so that there is no ambiguity and this is a format Excel recognizes.
Also if a cell shows "######" it may not be wide enough to display the date in the selected format, -try widening the column.