Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...