Formula criteria in allocation

when I use Formula to allocation GL account ,but it is divided equally. It is not allocated proportionally according to the value returned by the BAQ 。
How to write this formula?
For each target account, the value returned by G2 is different

there are 2 BAQ,One is the total ratio, and the other is the different ratios corresponding to the Department,