No it's not solved yet. When I reply I got it, i meant I got how to upload the excel file part.

The logic behind the number is that item X has 33 stock available for transfer. By going through the branch in the order of priority:
- Branch B has requested no stock so the stock of Branch A remains at 33
- Branch C has requested 31 stock so 31 will be transfer from A to C, leaving A with 2 stock
- Branch D has requested 8, but A has only 2 left so the stock to be transfer will be 2.

The stock that is to be transfer to each branch will be from Branch A only, and the order of the transfer will always be B, C, D then E.

Hope this makes it more clear. Thanks.