How to calculate a volume of a solid with four different corner depths I'm currently trying to calculate the volume of a relatively rectangular solid where all four corner points are at different depths. I'm aware it's probably a pretty simple solution, but for some reason my brain just isn't working this morning. 
I've drawn a rough sketch of the appearance of the shape

The sides with matching colours are the same lengths. 
Any help would be greatly appreciated, and I thank you so much. 
 A: 
let $AB=h_1,EF=h_2,GD=h_3, HC = h_4$ , Let $AHGF$ be a rectangle base with $AH=l \ and \ AF=b.$
(I know the diagram is not clear but as you can see I am trying to cut figure by a plane which is prependicular to $AHGF$ and have a thickness $dx$)
lets say plane cuts $BC\ at\ K , ED\ at \ L, AH\ at\ M, GF \ at \ N.$
So $MK= h_1+(h_4-h_1)\frac{x}{l}=t(x)$ and $NL=h_2+(h_3-h_2)\frac{x}{l}=s(x).$
So the area of the trapezium $'KLMN'=\frac{s(x)+t(x)}{2}b$
So the required volume is $\int_0^l [\frac{s(x)+t(x)}{2} \times b]dx$
So final answer is $\frac{h_1+h_2+h_3+h_4}{4}lb$(as the $@ 'Jaap Scherphuis'$ said)
A: If you have a box with rectangular basis $A \times B$, with coordinates 
$$(0,0,0),(A,0,0), (0,B,0), (A,B,0),$$ 
and corresponding upper corners at
$$(0,0,p),(A,0,q),(0,B,r),(A,B,s)$$ 
(these ones being non-coplanar in general).
you can "fit" on it the following second degree surface with equation :
$$z=\dfrac{1}{AB}\left(p(A-x)(B-y)+qx(B-y)+r(A-x)B+sxy\right) \tag{1}$$
(it works almost magically : take for example the case where $x=A$ and $y=0$ : only one term survives, the term $qx(B-y)$ whose value in this case is $qAB$, which finally gives $q$ because of the division by factor $AB$).
Now, the volume is very easy to obtain by integrating (1).
All computations done, (see remark below).
one obtains :

$$V=AB\dfrac14(p+q+r+s)$$

See a figure in a previous answer.
This technique is called bilinear interpolation. The skew surface $z=f(x,y)$ given by (1) is called a hyperbolic paraboloid (which is a ruled surface).
Remark : Example of integration :$$\int_{x=0}^{x=A} \int_{y=0}^{y=B} pxy dx dy \ = \ p[\dfrac{x^2}{2}]_0^{A}[\dfrac{y^2}{2}]_0^{B} \ = \ p\dfrac{A^2}{2}\dfrac{B^2}{2}.$$
