TITLE: Is there a Serre Tor formula for nonproper intersections?
QUESTION [14 upvotes]: Background: Let $X$ be a smooth complex projective algebraic variety, and let $V$ and $W$ be closed subvarieties.  For simplicity, let's assume that $\dim V+\dim W=\dim X$.
Now Serre's famous Tor formula says that if $V\cap W$ has dimension zero, we have:
$$V\cdot W=\sum_{Z\subset V\cap W}\sum_{i=0}^\infty(-1)^i\operatorname{length}_{\mathcal O_{X,z}}\operatorname{Tor}_{\mathcal O_{X,z}}^i(\mathcal O_{X,z}/I_V,\mathcal O_{X,z}/I_W)$$
where the sum is over the irreducible components of $V\cap W$ (in this case, a finite number of points).
However (according to Wikipedia here), if $Z$ is an irreducible component of $V\cap W$ with positive dimension (this is called a nonproper intersection), then the alternating sum of $\operatorname{Tor}$'s, which I'll call $\mu(Z;V,W)$, is zero.  Unfortunately, this means it cannot be used in exactly the same way as before to calculate $V\cdot W$.  For example, if $V=W$, then the answer would always be zero, though certainly there exist half-dimensional varieties $V$ with $V\cdot V\ne 0$ (in fact it can even be negative).
Is it possible to remedy this situation?  How does one count the intersection multiplicity if the intersection is not proper?
Comment: I know how to compute the self-intersection $V\cdot V$ as the top chern class of the normal bundle evaluated on $[V]$.  I'm looking here for an answer that's the most general, i.e. applies to all $V$ and $W$ of complementary dimension, regardless of the dimension of their intersection.

REPLY [11 votes]: Let $ch_i(F)$ denote the $i$-th coefficient of the Chern character of a sheaf $F$. Then
$$
V\cdot W = \sum_{i=0}^n (-1)^i ch_n(Tor_i(O_V,O_W)),
$$
where $n = \dim X$, $O_V = O_X/I_V$, $O_W = O_X/I_W$, and one uses a natural identification of $H^{2n}(X,{\mathbb Z})$ with ${\mathbb Z}$.