Real time PCR normalization algorithm
First step is the calculation of efficiency, denoted by lets say $E_{gene}$. See this post for calculation of primer efficiency.

So the fold change for that gene will be calculated by $E_{gene}^{-\Delta Ct_{gene}}$

Where:

$\Delta Ct  = Ct^{treated} -Ct^{control}$

But these Ct values are not normalized. For normalization, you take some reference gene which need not be a housekeeping gene. Reference gene should chosen such that it is not affected by the treatment. In some cases usual housekeeping genes can also get affected for e.g. in treatments affecting cell cycle or differentiation. In such cases you should use a spike-in (an artificial RNA bearing low resemblance with any known gene).

You can either normalize the fold change (Case A) or find fold change of the normalized expression (Case B). 

Means the same mathematically.

Case A:

$E_{gene}^{-\Delta Ct_{gene}} / E_{ref}^{-\Delta Ct_{ref}}$

Case B:

$\large\frac{[E_{gene}^{-Ct^{treated}_{gene}}]/[E_{ref}^{-Ct^{treated}_{ref}}]} {[E_{gene}^{-Ct^{control}_{gene}}]/[E_{ref}^{-Ct^{control}_{ref}}]}$

You can rearrange the numerator and denominator to get Case A from Case B. I'm not sure how you are ending up getting different values. Recheck once. It may be because of numerical approximation errors. 

Case A looks much neater; so it is best to calculate that way :)