I created a macro that uses solver to help setup the first value in column F. In solver I set the objective cell to the value in column C to a max value by changing the value in column F. The constraints are column C must equal column B. The values in column F thru Q represent income over 12 months and are increasing by 3% over those 12 months. The values in column C are the sum of column F thru Q. I have discovered a few things when trying to get this to work... first if I have the macro (Macro12) take the values in column B and divide by 12.2months in column F it helps get solver closer to an answer. Second, for this problem it seems as though solver does not like values under $1,500. Third, solver uses values/answers that are E-13 ( E to the power of -13 or 13 digits on the right side of the decimal) when I manually enter (or manually use random numbers) values I can figure out an answer that is only 3 to 4 digits on the right side of the decimal. I my mind solver is trying to hard and it does not take a 13 digit or longer value to solve this problem. Also, if this can be done using formulas that would be better than solver and a macro.
Cell Formulas | ||
---|---|---|
Range | Formula | |
G1:Q1 | G1 | =F1+1 |
F2:Q2 | F2 | =ROUNDUP(F1/12,0) |
E3 | E3 | ='Summary Sheet'!B7 |
F3:Q3 | F3 | =EOMONTH(E3,1) |
A5,A7:A20 | A5 | =IF(C5=B5,"GOOD","ERROR") |
B5,B7:B20 | B5 | ='Projections '!C6 |
C5,C7:C20 | C5 | =ROUND(SUM(F5:Q5),2) |
G7:Q20,G5:Q5 | G5 | =F5*(1+HLOOKUP(ROUNDUP(F$1/12,0),'Projections '!$C$1:$AF$2,2,0))^(1/12) |
F21:Q21 | F21 | =SUM(F7:F20) |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
'Monthly Cash Flow'!solver_adj | ='Monthly Cash Flow'!$F$16 | F21, C16, G16 |
'Monthly Cash Flow'!solver_lhs1 | ='Monthly Cash Flow'!$C$16 | A16 |
'Monthly Cash Flow'!solver_lhs10 | ='Monthly Cash Flow'!$C$8 | A8 |
'Monthly Cash Flow'!solver_lhs2 | ='Monthly Cash Flow'!$C$5 | A5 |
'Monthly Cash Flow'!solver_lhs3 | ='Monthly Cash Flow'!$C$7 | A7 |
'Monthly Cash Flow'!solver_lhs4 | ='Monthly Cash Flow'!$C$5 | A5 |
'Monthly Cash Flow'!solver_lhs5 | ='Monthly Cash Flow'!$C$7 | A7 |
'Monthly Cash Flow'!solver_lhs6 | ='Monthly Cash Flow'!$C$8 | A8 |
'Monthly Cash Flow'!solver_lhs7 | ='Monthly Cash Flow'!$C$5 | A5 |
'Monthly Cash Flow'!solver_lhs8 | ='Monthly Cash Flow'!$C$7 | A7 |
'Monthly Cash Flow'!solver_lhs9 | ='Monthly Cash Flow'!$C$8 | A8 |
'Monthly Cash Flow'!solver_opt | ='Monthly Cash Flow'!$C$16 | A16 |
'Monthly Cash Flow'!solver_rhs1 | ='Monthly Cash Flow'!$B$16 | A16 |
'Monthly Cash Flow'!solver_rhs10 | ='Monthly Cash Flow'!$B$8 | A8 |
'Monthly Cash Flow'!solver_rhs2 | ='Monthly Cash Flow'!$B$5 | A5 |
'Monthly Cash Flow'!solver_rhs3 | ='Monthly Cash Flow'!$B$7 | A7 |
'Monthly Cash Flow'!solver_rhs4 | ='Monthly Cash Flow'!$B$5 | A5 |
'Monthly Cash Flow'!solver_rhs5 | ='Monthly Cash Flow'!$B$7 | A7 |
'Monthly Cash Flow'!solver_rhs6 | ='Monthly Cash Flow'!$B$8 | A8 |
'Monthly Cash Flow'!solver_rhs7 | ='Monthly Cash Flow'!$B$5 | A5 |
'Monthly Cash Flow'!solver_rhs8 | ='Monthly Cash Flow'!$B$7 | A7 |
'Monthly Cash Flow'!solver_rhs9 | ='Monthly Cash Flow'!$B$8 | A8 |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A5,A23:A57,A7:A20 | Cell Value | contains "ERROR" | text | NO |
A5,A23:A56,A7:A20 | Cell Value | contains "GOOD" | text | NO |