Hi all professionals, I need help to get a desired output about amounts and days differences. So I have Account, Debit amount and Credit amount. I need the days difference between two Debit amounts and sub-total value of Credit amount lying between two Debit amounts. Also remaining amount of Debit amounts minus the sub-total value of Credit amount. Also the first line wherever there is Debit amount should not be considered and the output should be calculated from next line and there can be missing dates which should be considered as it is as they are actually missing. The calculation should start again as the account changes. Hope I'm able to explain as much as I can. Attached is the sample for reference. Kindly help with a desired solution. Thank you.