Combinatorial proof of $\sum_{1\le i\le n,\ 1\le j\le n}\min(i,j)=\sum_{i=1}^ni^2=\frac{n(n+1)(2n+1)}6$ $$\sum_{1\le i\le n,\ 1\le j\le n}\min(i,j)=\sum_{i=1}^ni^2=\frac{n(n+1)(2n+1)}6$$
Is there a link, if any, between these two identical sums?

$$\begin{array}{rr|rrrrrrr}
\hline
\min(i,j)&&i\\
&&1&2&3&4&\cdots &(n-2)&(n-1)&n\\
\hline
j&1&1&1&1&1&\cdots &1&1&1\\
&2&1&2&2&2&\cdots &2&2&2\\
&3&1&2&3&3&\cdots &3&3&3\\
&4&1&2&3&4&\cdots &4&4&4\\
&\vdots&&&&&\ddots \\
&\vdots \\
&\vdots \\
&(n-2)&1&2&3&4&&\color{green}{(n-2)}&\color{green}{(n-2)}&\color{green}{(n-2)}\\
&(n-1)&1&2&3&4&&\color{green}{(n-2)}&\color{blue}{(n-1)}&\color{blue}{(n-1)}\\
&n&1&2&3&4&&\color{green}{(n-2)}&\color{blue}{(n-1)}&\color{red}n\\
\hline
\end{array}$$
From the table above it is clear that 
$$\begin{align}
\sum_{1\le i,j\le n}\min(i,j)
&=\color{red}{1\cdot n}+\color{blue}{3\cdot (n-1)}+\color{green}{5\cdot (n-2)}+\cdots+(2n-1)\cdot 1 \\
&=\sum_{r=1}^n (2r-1)\color{orange}{(n+1-r)}\\
&=\sum_{r=1}^n \color{orange}{\sum_{i=r}^n}(2r-1)\\
&=\sum_{i=1}^n\sum_{r=1}^i (2r-1)
\color{lightgrey}{=\sum_{i=1}^n\sum_{r=1}^i r^2-(r-1)^2}\\
&=\sum_{i=1}^n i^2\quad\blacksquare\\
\end{align}$$
