Can you please review this links, it will demon strait how to export data to Excel. for your solution, you need to do this steps.
1) on web page enter value in text boxes
2) as user click on button, fire select query over your sql sever database which filter your records based on your text boxes value and filled out data table or data set as per your resulted data
3) use export to excel functionality from given links (you need to modified code for export to excel as per your requirement)
reference links for export to excel
Export to Excel[
^]
Export to Excel from Gridview and Data Table[
^]