shinju,

Your formula looks fine... can you attach a sample spreadsheet so that we can see where things are breaking down... Go Advanced, Manage Attachments...