I'm trying to create a macro that will perform calculations for an invoice. I know that I can do much of the calculations in the back end within a script, but I'm writing the macro for my boss who would be interested in seeing the formulas in the Excel Spreadsheet.
Here's my main problem. For several formulas in my summary worksheet, I'm either adding or multiplying for expenses.
Sample for Cell A2 in my Summary Worksheet:
Expense = sum(CP!G60 * 1.025 - HS!A5 - CP!G69)
where G60 refers to 'Estimate' & G69 refers to 'Adjusted Amount' from worksheet CP, and A5 refers to 'Losses' from worksheet HS.
What makes this difficult is that the values that show up on'G60', 'G69', and 'A5' are not absolute locations. They can be dynamic based on other things happening on their respective worksheets (ie for November, they're 'G70', 'G70', and 'A15' respectively)
Someone suggested naming ranges, but I don't know how to name a range when the cell is dynamic.
If range is the way to go, at least the formula can look like this:
=sum(Estimate*1.025 - Adjusted Amount - Losses)
Maybe I'm making this overcomplicated. I've been working on this all day and it's driving me crazy. Any help would be much appreciated.
Here's my main problem. For several formulas in my summary worksheet, I'm either adding or multiplying for expenses.
Sample for Cell A2 in my Summary Worksheet:
Expense = sum(CP!G60 * 1.025 - HS!A5 - CP!G69)
where G60 refers to 'Estimate' & G69 refers to 'Adjusted Amount' from worksheet CP, and A5 refers to 'Losses' from worksheet HS.
What makes this difficult is that the values that show up on'G60', 'G69', and 'A5' are not absolute locations. They can be dynamic based on other things happening on their respective worksheets (ie for November, they're 'G70', 'G70', and 'A15' respectively)
Someone suggested naming ranges, but I don't know how to name a range when the cell is dynamic.
If range is the way to go, at least the formula can look like this:
=sum(Estimate*1.025 - Adjusted Amount - Losses)
Maybe I'm making this overcomplicated. I've been working on this all day and it's driving me crazy. Any help would be much appreciated.