Nice (and pretty standard) homework.

How about setting up an excel file, test it, and then come back if something is wrong?

HTH,

Francesco