Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

average - Implement p-mean in excel

I'm spreadsheeting my favorite albums and I'd like the good tracks on the album to count more for its average than the bad songs. I thought about geometric means, but those do the opposite of what I want.

I found the p-mean, which approaches the maximum of the dataset as p goes to infinity: enter image description here

Is there any way to implement this formula in only one cell? If p=2, I can use sqrt(sumsq()) but I'm not sure how to implement it if p > 2. It's impractical for me to add adjacent cells in each column.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's how I ended up doing it:

=(SUM(IF(ISNUMBER(E2:E99),E2:E99^N))/COUNT(E2:E99))^(1/N)

This is an array formula, so it must be entered with ctrl + shift + enter rather than just enter.

Credit goes to Scott Craner.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...