Let $X$ be a CW-complex. Define an equivalence class on $X$ to be $\alpha(X)$, and $Y \in \alpha(X) \iff Y$ homotopy equivalent to $X$.
Define an ordering on cell structures:
The cell structure with a smaller number of cells is smaller. E.g. $e_0 \cup e_5 < e_0 \cup e_1 \cup e_2$ since $2 < 3$.
Given two cell structures with the same number of cells, the first dimension counting from $0$ in which the number of cells differs determines the smaller cell structure to be the one that has more cells in that dimension. E.g. $e_0 \cup e_3 < e_0 \cup e_4$ since the first dimension in which the cell multiplicities differ is $3$ and $e_0 \cup e_3$ has $1$ cell $e_3$ in that dimension while $e_0 \cup e_4$ has $0$ and $1 > 0$.
Define a minimal cell structure for $X$ to be the least cell structure out of all possible cell structures for all $Y \in \alpha(X)$ under the just defined ordering.
Claim: For every dimension $n$, the betti number of $n$-th homology group of $X$ is the Cartesian power coefficient of the cell $e_n$ in the minimal cell structure of $X$.
Examples:
$S^n = e_0 \cup e_n$, $H_i(S^n)=\mathbb{Z}$ if $\in \{0, n\}$, $H_i(S^n)=\mathbb{0}$ if $i \notin \{0, n\}$, claim holds here, $S^n$ is orientable.
$T^2 = e_0 \cup e_1^2 \cup e_2$, $H_0(T^2) = \mathbb{Z}$, $H_1(T^2) = \mathbb{Z}^2$, $H_2(T^2) = \mathbb{Z}$, $H_i(T^2) = 0$ for $i>2$, claim holds, $T^2$ is orientable.
Solid Torus. $D^2 \times S^1 = e_0 \cup e_1^2 \cup e_2^2 \cup e_3$, but $D^2 \times S^1$ is homotopy equivalent to $S^1 = e_0 \cup e_1$ which has fewer cells in its cell structure. Hence $H_i(D^2 \times S^1) = \mathbb{Z} \iff i \in \{0,1\}$ and $H_i(D^2 \times S^1) = \mathbb{0} \iff i > 1$, claim holds, the solid torus is orientable and all its homology groups are torsion-free.
Projective space $\mathbb{R}P^2=e_0 \cup e_1 \cup e_2$ and $H_0(\mathbb{R}P^2)=\mathbb{Z}$, $H_1(\mathbb{R}P^2)=\mathbb{Z_2}$, $H_i(\mathbb{R}P^2)=0, i>1$. But $\mathbb{R}P^2$. The claim does not hold. $\mathbb{R}P^2$ is not orientable.
Projective space $\mathbb{R}P^3=e_0 \cup e_1 \cup e_2 \cup e_3$ and $H_0(\mathbb{R}P^3)=\mathbb{Z}$, $H_1(\mathbb{R}P^3)=\mathbb{Z_2}$, $H_3(\mathbb{R}P^3)=\mathbb{Z}$, $H_i(\mathbb{R}P^3)=0, i>3$ or $i=2$. The claim does not hold. $\mathbb{R}P^3$ is not orientable. It has $H_1(\mathbb{R}P^3)=\mathbb{Z_2}$ which is not torsion-free.
Question: What are the least restricting conditions for a $CW$-complex implying the claim? It may hard to find the most general conditions, but the more general the more I will appreciate the answer!
Some of the conditions on $X$ to consider:
$X$ is orientable.
homology groups of $X$ are torsion-free.
$X$ is a manifold.