It would be more feasible to do all your logic with perl and have that program write the final product to your Excel spreadsheet using modules like
. It does not make sense to overload an Excel sheet with logic, because that is not the focus of that particular application.