Not many will help in the form of just writing a script to suit your needs. For starters you ought to determine how to calculate what you wish from the available data, in parallel determining if you have sufficient data to accomplish this. The next step would be to attempt a script, either with awk, bash, python, or some other script language. I just said in another thread that I'm not highly experienced with awk, but ... I don't believe it is a script language. Bash is, as is python, tcl, and perl. Awk is a pattern scan and processor; which will do actions; however you'd use something like a bash script to invoke awk in the way you wish. For instance, say you have record files and need to extract specific parts of records to use as the numbers for your calculations, then you'd use awk to help you there; and as said earlier, you'd use a scripting language to perform the rest of the operations.
Here are some references on bash:
Bash Guide for Beginners
Advanced Bash Scripting Guide
Blog Entry on Bash Scripting