I assume you're referring to non-CBC questions here, such as numerics, select-type questions, or grids.
You could create a new variable within a Free Format question, and make it a "hidden" type variable. Then, when you set its value (within the HTML script), you can include some SSI Script (script enclosed within [% and %] brackets). Within those brackets you may refer to variables and use parentheses and addition and division operations.