When I use a formula in Excel and don't have an exact formula to use or when it is burdensome to make a formula with bunch of functions many times, I go to VBA and make a user-defined functions.
It is really time-consuming to make a same formula over and over. Is there a way to make a user-defined function?
For example, if [field1] > [field2] then [field1]*[field2] elseif [field1] = [field2] then -1 else [field1]/[field2]
I want to define the above expression as a function, multiplyOrDivide([field1], [field2]). I have way too many columns to copy and paste the formula and change each argument in the parameters.