I am doing some analysis on bank data, and I'm having difficulty tidying the data set. I also had difficulty putting this in a reprex, so I thought it was easiest to just show a small sample of the data. The data represents transactions that have start and end date that can vary from one month to multiple years. I need to transform the transaction data into a series of monthly transactions based on the transaction term. This looks to be gathering exercise, but I could not figure out to break the dates into monthly pieces.

The original data set is as follows:

I need to get the data into the following format:

Any suggestions on how to do this would be greatly appreciated.

Thanks