Here is how to calculate some fields with AWK in #Emacs from tab-separated data (converted to CSV on-the-go):
Grab the #hawk package at https://sr.ht/~hajovonta/hawk/
It uses the awk-mode to have syntax coloring and automatic indentation for your script, and evaluates your output with each keystroke (beware of side effects).