I have an Excel file attached with 4 sheets (Plan, PlanXSubPlan, Code list and Worksheet).
+ The sheet Plan and PlanXSubPlan will be always feed by me/human!
+ The sheet Code list has 4 columns, 3 of them (Code, Start, end) will always be feed by me/human too. The column PLAN (ID1) must identify which plan each row belongs by using the Start and End as reference, going to the PlanXSubPlan sheet (trough the first"Start" date and the last "End Date" per Plan ID, consequently finding out the Plan Id1. Maybe you need a macro here.
+ The sheet Worksheet has 5 columns, 4 of them (Code, Period, Start, end) will always be feed by me/human too. The column "Total days - days in P" is the main goal (that´s what i really need to have).
+ There you can calculate the "Total days - days in P" = "Start" - "End", but it´s necessary to know, trough the Code, which plan belongs to this code, then go to the PlanXSubPlan and not count the period where Type starts with "P" (P1, P2, P3, P4, P5). Maybe you need a macro here too.
I would like to have basically 2 Excel macros (maybe 1 or many, you decide) according my logic. But you are free to solve it as you wish. I just need the final result ready. Remember the sheet will be constantly updated, so maybe a button would be better to have or you can just make it real time. You decide it!
So, I hope you can help me doing this task.
Thank you and fell free to ask me questions.