This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Here's one way you can do it, the only downside with this workflow is that if your dataset is much larger than the example you gave above then it will take some manual adjustments to make it work. I'd started a fully automated version for this but it would take a while, hopefully this should make some sense when you see the workflow.
Give the attached a try. I had to split the data into three streams (1st row, 2nd row, and remaining) and do a little bit different manipulation for each. I'm also assuming that rows 3+ should be summed up in the "Amount" column, so if that's not the case you'll need to play with it a little.