# Why these two formulas are not exactly the same

I have 2 formulas which should give the same number but they differ by about 1%:

=POWER(VARP(A2:L2);2) gives 142,006944 but

=(SUMPRODUCT((A2:L2-6,5)^2)) gives 143

Here 6,5 is the =AVERAGE(A2:L2)

Please see the two snippets below.

edit retag close merge delete

1

-1- Please stop posting such images. Lots of "area", very little information. Attach a sample document instead if not the question is explicitly about the view.
-2- Why would you expect equal results? 11.91667 * 12 <> 11.91667^2 should be obvious.

( 2021-01-17 13:53:33 +0200 )edit

I do not follow your answer. I do not know why it matters posting pictures of my problem, are you using a mobile phone that such a reasonably small area matters? Also, both these formulas should be the second central moment and hence the same.

( 2021-01-17 14:25:09 +0200 )edit
1

You need to compare VARP(A2:L2) and =SUMPRODUCT((A2:L2-6,5)^2)/COUNT(A2:L2) (Average of deviation squares).

( 2021-01-17 14:36:15 +0200 )edit
1

To make it slightly clearer: why do you square variance? There you have your error. Both @Lupp and @Opaque have mentioned that.

( 2021-01-17 15:02:15 +0200 )edit
1

@Mike Kaganski - here seems to be the trap caused by standard nomenclature of variance:=σ2 and assuming function VARP() calculates σ.

( 2021-01-17 15:31:46 +0200 )edit

This is strange: =POWER(SUMPRODUCT(((A2:L2-6,5)^2)/12);2) computes the =VARPbut I'm confused why there is =POWER....; 2) ?? The variance =VARP should be E(X-EX)^2 which is exactly =SUMPRODUCT((A2:L2-6,5)^2)/COUNT(A2:L2) but only after =POWER....; 2) this is equal to =VARP: in LibreOffuice,, why there must be this extra =POWER? for equality with =VARP?

( 2021-01-17 16:46:46 +0200 )edit

=POWER(SUMPRODUCT(((A2:L2-6,5)^2)/12);2) computes the =VARP

No.

@Opaque: quite true!

( 2021-01-17 16:52:15 +0200 )edit

I do not know why it matters posting pictures of my problem, are you using a mobile phone that such a reasonably small area matters?

It is not bad to post screenshots of your problem per se. However, it is good when poster only posts screenshots in addition to also posting the editable document, so that others do not waste time re-creating sample documents to experiment with, possibly also being uncertain if the screenshot had hidden some important details like numeric precision defined in number format of the cells in question. Yes, it's rather easy to reconstruct this sample anew, but even this case would be more friendly to those who you intend to get help from, if you still provide the sample.

( 2021-01-18 08:04:20 +0200 )edit

Sort by » oldest newest most voted

Hello,

I did not intend to add an answer to this but due to lengthy discussion, revisited my decision.The short version of the answer to your question: The 2 formulas calculate different values and are not equal.

For a more detailed answer, check this image of pseudo formulas:

why there must be this extra =POWER

It was you, who started using this. No comment stated that it is required, but all comments tried to convince you of the contrary. Therefore the only reason to start the formulas above with POWER() as well, is motivated by trying to clarify the original, underlying misunderstanding.

more