A basic check could be to check the available column headers in the excel sheet. With the apache poi java library you can get the headers and then compare the values with those in the template definition.
See for example: https://stackoverflow.com/questions/24430222/accessing-column-headers-of-an-excel-file-in-java