Formula relating Euler characteristics $\chi(A)$, $\chi(X)$, $\chi(Y)$, $\chi(Y \cup_f X)$ when $X$ and $Y$ are finite. This is a followup to my question here.

Let $A$ be the subcomplex of a CW complex $X$, let $Y$ be a CW complex, let $f: A \to Y$ be a cellular map, and let $Y \cup_f X$ be the pushout of $f$ and the inclusion $A \to X$. Is there a formula relating the Euler characteristics $\chi(A)$, $\chi(X)$, $\chi(Y)$, and $\chi(Y \cup_f X)$ when $X$ and $Y$ are finite?
Indeed, there is. Let $Z=Y \cup_f X$ be the pushout of the diagram $X\leftarrow A\rightarrow Y$. I claim that $$\chi(Z)=\chi(X)+\chi(Y)-\chi(A).$$

To see this, let us first recall the following general fact


  For any chain complex $C_*$ it holds that $$\sum_n (-1)^n \text{rank }C_n = \sum_n (-1)^n \text{rank }H_n(C_*).$$


This is rather simple to prove and you can read about it, for example, in Hatcher's proof of Theorem 2.44.

Now consider the Mayer-Vietoris sequence corresponding to the above pushout:

$$\cdots \underbrace{H_1(Z)}_{C_3}\to \underbrace{H_0(A)}_{C_2}\to \underbrace{H_0(X)\oplus H_0(Y)}_{C_1}\to \underbrace{H_0(Z)}_{C_0}\to 0 $$

Any long exact sequence may trivially be considered a chain complex, so let's define $C_i$ as indicated above. Then since the homology of an exact chain complex vanishes, we have $\text{rank }H_n(C_*)=0$ for all $n$. Hence, we get
$$\begin{eqnarray}0&amp;=&amp;\sum_n (-1)^n \text{rank }H_n(C_*)
\\&amp;\stackrel{\text{General fact}}{=}&amp; \sum_n(-1)^n\text{rank }C_n
\\&amp;\stackrel{\text{Def. of }C_i}{=}&amp;\text{rank }H_0(Z) - (\text{rank }H_0(X) +\text{rank }H_0(Y)) + \text{rank }H_0(A) -\text{rank }H_1(Z)+\cdots
\\&amp;\stackrel{\text{Euler-Poincare formula}}{=}&amp;\chi(Z) - (\chi(X)+\chi(Y)) + \chi(A)
\end{eqnarray}$$

which implies the claim.
You don't need homology or Maier-Vietoris for this. Simply observe that the relative cells of $(Y\cup_F X, Y)$ are in bijection with those of $(X,A)$.