how to create a formula ?

this is the ledger for the month of march

here, column G represents the loan amount that allotted to employees(in column B). Maximum 2 employees get loan benefit in a month. may be to the first employee and to the last one in the list.
i want to create a formula to share the amount from the cell(may be in G1 and G2, or G4 and G10…) it is entered in column G to the column D2 and D3 in the sheet that i uploaded below

i want to share their name as well to C2 and C3. is there any way to do it ?

Hello, it would be nice if you could change your subject/question to something more useful so other people also can benefit from the answers you get. Formula is very wide :wink:

Have you been looking into using a pivot table for this? Taking a quick look at your problem that might provide a simpler solution.

Maybe these descriptions will help you:


[Basic arithmetic operations and simple functions in Calc](https://wiki.documentfoundation.org/Videos/Basic_arithmetic_operations_and_simple_functions_in_Calc)
[Housekeeping book in Calc](https://wiki.documentfoundation.org/Videos/Housekeeping_book_in_Calc)
[English documentation](https://documentation.libreoffice.org/en/english-documentation/)