I am trying to create a new column that has the average monthly budget based on the duration of a campaign
My current data set looks like this
| Client | Start Date | End Date | Campaign | Total Budget |
|---|---|---|---|---|
| ABC | 01/01/2024 | 31/01/2024 | 123 | 1,000 |
| DEF | 01/01/2024 | 31/03/2024 | 456 | 15,000 |
| XYZ | 01/01/2024 | 30/06/2024 | 789 | 60,000 |
What I would like to do is to equally divide the Total Budget column for each line based on the duration of the start/end dates
Row 1: 1 month
Row 2: 3 months
Row 3: 6 months
etc
I'm not sure where to begin with trying to code this so I was wondering if this was even possible to do?
My expected result would be the below
| Client | Start Date | End Date | Campaign | Total Budget | Avg Monthly Budget |
|---|---|---|---|---|---|
| ABC | 01/01/2024 | 31/01/2024 | 123 | 1,000 | 1,000 |
| DEF | 01/01/2024 | 31/03/2024 | 456 | 15,000 | 3,000 |
| XYZ | 01/01/2024 | 30/06/2024 | 789 | 60,000 | 10,000 |
Result: