Search criteria for DSUM function

I am trying to use Libre Office Calc to carry out an inventory management simulation.

There is a column headed “Day” containing the number of days from the start of the simulation. There is a column headed “Order quantity” containing the quantity ordered on that day. There is a column headed “Arrival day” containing the number of the day on which that order is expected to arrive.

There is a column headed “Received”. Each cell in that column will contain a DSUM function giving the total quantity expected to be received from the supplier on that day. That quantity is the total of the numbers in the “Order quantity” column for which “Arrival day” is equal to the value of “Day” in the row containing the DSUM function concerned. I can’t find any method of specifying this search criterion.

If it is not possible to do this using DSUM then is there any other way of doing it in Calc?