Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Yes, that is exactly the book that I looked at first. I didn't find the formula there (Of course I might have missed it). But there is this other formula $\mbox{depth}(X)=\min\{i\ |\ \mbox{Ext}^i_R(k,X)\not=0\}$. Thus there is probably some duality involved.