First, thanks very much for even reading this at all because it is very long and I apologize for that. It’s a pretty big problem.
I have a very complex formula to figure out that deals with budgetary costs being populated correctly for each month and I’m not having much luck. In fact, it’s a bit overwhelming and I feel that I’m in way over my head on this one. Can you help?
See the attached workbook. Be aware that this workbook is in a transitional mode with many things (mostly VBA) not working at the moment due to lots of recent additions of columns, one of which is what this post is about.
For ease of working with the specific variables, I’ve kept the sheet unlocked and have hidden all columns on the worksheet that don’t pertain to the problem, as there are many on this sheet. I also included 12 rows with pre-entered test data, all ready for the months to test formulas with.
I will try to be as descriptive as possible.
For each cell in the month columns (AP:BA) on the Budget_Data sheet, the formula needs to use variables located in columns Q, X and AG:AO to derive the correct value to be applied to any given month or months for the next budget year.
The variables are:
- Q14 = “Recurring Fee” – Must be selected from Q14 for any of the rest of this to apply at all. All other selections from Q 14 would be assumed to only apply to the month select in the Start Month in AK14.
- X14 = The action for the Recurring Fee (Add, Remove, Renew – anything chosen outside of these is assumed to only apply to the Start Month chosen)
- AG14 = The quantity of an item to be purchased – This would always be “1” with a Recurring Fee and the amount in AH14 will be applied to specific months based on other criteria, below.
- AH14 = The total cost per item per Payment Cycle in AO14.
- AK14 = The month that the recurring fee will begin
- AL14 = The month number, a helper column for AK14
- AM14 = The month that a recurring fee will end
- AN14 = The month number, a helper column for AM14
- AO14 = The payment cycle for the recurring fee (One-Time, Monthly, Quarterly, Semi-Annual, Annual)
Rule: There can’t be both a Start and End month for any record (row). It must be one or the other and the formula for each month needs to automatically adjust for this. For any Start Month, the monthly payment should begin in the selected month and continue through December, and for any End month, the payment should be applied to this month and all months prior to the End Month but both based on the Payment Cycle selected in AO14.
For instance, there are 3 actions in X14 and 5 in AO14 that the formula needs to account for:
- The recurring fee will be Added and will start in a specific month (AK14) based on the Payment Cycle.
- The recurring fee will be Renewed, in which case, it will be applied to all months, based on the Payment Cycle.
- The recurring fee will be Removed and will be ending on a certain month but needs to be applied to this month and all months prior to the ending month based on the Payment Cycle.
Each of the above must apply to months based on the Payment Cycle chosen from AO14, One-Time, Monthly, Quarterly, Semi-Annual or Annual.
- For “One-Time” fee, the amount in AH14 should be applied to the Start Month chosen in AK14.
- For “Monthly”, the amount in AH14 should be applied to each month, beginning with the Start Month that was selected in AK14 and should continue through December.
- For “Quarterly”, the amount should be applied to the Start Month in AK14 and then every 3 months through December.
- For “Semi-Annual” the amount should be applied to the Start Month and then to the 6th month after, unless it goes beyond December, since we’re only working with one year at a time.
- For “Annual”, the amount should only be applied to the Start Month just like a “One Time” fee.
Should any of the month cells see that the data in X14 = “Remove”, then they should look at the End Month in AM14 instead of the Start Month in AK14 and include only the End Month and months before the End Month for the amount in AH14 to be applied, basically the opposite of what they do using the Start Month explained above.
If you have any questions about anything I might have left out, please let me know.
And again, thanks very much for any help you can provide.
Bookmarks