• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Maximum Total Optimization

canernas

New Member
Dear Chandoo Family,

I am working on a project. The goal of this project is to minimize the SUM formulas in the column totals located in row 14 of the table found in the attached Excel file. Rows 3 to 12 specify the total demand for each 5-minute interval, cell by cell. To minimize the column totals in row 14, the numbers in the rows need to be shifted. By shifting these numbers, I will obtain the most optimal subtotals. There are some constraints while performing this operation:
  1. The numbers to be shifted can only be moved as groups. (For example, a group of numbers written as 3 - 3 - 3 in one row must remain 3 - 3 - 3 when moved.)
  2. The shifts should only occur between the blue cells and should not go outside the blue cells.
  3. The number group in one row cannot be moved to a different row; the shifting must occur within the same row.
I have been trying to implement this optimization using VBA code for days, but I couldn't find a solution. The last code I wrote in Excel is available; if you prefer, you can also work on the Backup sheet from scratch. I would appreciate your support, as I really haven't been able to find a way out! :)
 

Attachments

  • Optimization Macro.xlsm
    30.9 KB · Views: 3
Back
Top