(Solved) Sum of cells between dates LibreOffice Calc

I am trying to figure out a way to automatically total amounts for every Quarter so I need to figure out a cell formula that only make a sum of cells between certain days.

I don’t know all the operators, and script or programming options but here’s some pseudo code for kinda what I’m trying to do.

PSEUDO CELL FORMULA (A column is Dates, D Column is Currency Values)

SUMIFS(D4:D37,A4:A37,<=Date(01/01),>=Date(03/31))

PSEUDO SCRIPT

**TOTAL**=0
For Each { **CELL** in **CELL_RANGE**
 if (**CELL** date is >= *Quarter Start date* &  **CELL** date is <= *Quarter End Date*)  then
     // Date is in the Quarter
     // E.G. get the deposit from that day
    **ADD_VALUE**=Get a different column value from the same row 
     //Add the deposit to the total
    **TOTAL**=**TOTAL+ADD_VALUE**
 )else(
    // Date is NOT in the Quarter Do Nothing
)
Return **TOTAL**

Updated Original Post.

You can’t the function in that way, criterias are not well formed.
=SUMIFS(D4:D37;A4:A37;">="&DATE(2020;1;1);A4:A37;"<="&DATE(2020;3;31))

SUMIFS help

Thank you for the example and the link to the help. It was very helpful thank you.
I did change things up a bit after reading the help and added 2 cells (G5, and G7) so I can change the dates by just plugging in new numbers.

=SUMIFS(D4:D37,A4:A37,">="&MIN(G5),A4:A37,"<="&MAX(G7))

MIN(G5)? Why the MIN? you are executing a function that finds a minimum of several passed values, and you are passing only a single value there, thus just slow down the formula.