Yes, this can be achieved with a script, but it's somewhat of a complex task if you don't have any experience at all with writing such scripts.
Also, you would need Acrobat to apply the script to the file (I'm assuming you have it, but you posted under the Reader forum...)
If you do indeed have Acrobat, try if you can convert the Excel sheet with IF statements to PDF. Maybe it will work?
Having converted Excel forms to PDFs, I would make the form in Word and then create the PDF form.
D.P. Story has the AcroTex product that is designed to create educational mathematical materials.