Not sure what formatting you mean in your question, but to retrieve data from Excel and store it to SQL, you can either use
Excel Interop[
^] or
Excel OLEDB[
^]. Of course, to be able to insert to the DB, you need to familiarize yourself with ADO.Net.