you can have a look at this other question: How to define a LaTeX macro in a Markdown cell of a Jupyter Notebook? (and its answer).
To be more generic: a notebook executes all the LaTeX commands in the same LaTeX environment.
It implies that you can write
[In one cell]: This is a Marco definition: $\def\Qc{Q^N_i}$ and use it in a formula of the same cell $\Qc=3$.
And you can later
[in another cell] Use it again $A=3\times \Qc$.