Geomean alternative for Averageifs

Lawrences

New Member
Joined
Aug 10, 2014
Messages
45
Hi, I am trying to find the geometric mean of a range of values based on another range of data and if that falls into a certain bin width. So for example, finding the geometric mean of the values in column B, only if the values of column A fall within a certain bin width that I set at 1.
NumberAmountBinGeomean
1.2561=GEOMEAN(IF(AND($A$2:$A$10<=C3,$A$2:$A$10>C2),$B$2:$B$10))
25452
2.5453
2.75444
2.85453
2.9523
3.156
3.557
3.7524

<tbody>
</tbody>

That formula I enter (and then drag down) does not work. It returns #NUM!
Those numbers are fictional, as the actual data has about 600 rows. However the concept is the same

Please can someone help me come up with a formula to calculate the geometric mean of column B, if column A falls within the bin size.

Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You cannot use AND in this way in array formulas.

Try nested IFs
=GEOMEAN(IF($A$2:$A$10<=C3,IF($A$2:$A$10>C2,$B$2:$B$10)))
confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.
 
Upvote 0
As an alternative you can also multiply the conditions. This also works properly
=GEOMEAN(IF(($A$2:$A$10<=C3)*($A$2:$A$10>C2),$B$2:$B$10))
Ctrl+Shift+Enter

M.
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top