Averageifs reciprocal

schtebben

New Member
Joined
Oct 26, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I am trying to use averageifs to find the average of the reciprocal without success. I can easily do this by creating extra columns with the reciprocal and taking the averageifs of those columns but I want to do it without any extra columns. I am using =AVERAGEIFS(GS_Data,GS_Data[Diff],"<"&L10,GS_Data[Diff],">="&K10) on the reciprocal column B without problems but I'd like something like =AVERAGEIFS(1/GS_Data[A],GS_Data[Diff],"<"&L10,GS_Data[Diff],">="&K10). Any idea how to do this?

AB
2.350.43
1.770.56
1.930.52
1.450.69
1.360.74
3.280.30
2.000.50
4.690.21
1.720.58
1.490.67
5.750.17
1.930.52
2.220.45
2.170.46
1.230.81
1.650.61
2.130.47
1.780.56
4.290.23
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
What is GS_Data, GS_Data[Diff], L10, K10 those are not displayed in screenshot.
 
Upvote 0
GS_Data is the table, GS_Diff is a column with a rating value and L10, K10 are upper and lower bounds for the rating values. I've created a new sample ... I'm trying to get the average of the reciprocal between particular values. The formula in this sample is: =AVERAGEIFS(GS_Data[F %],GS_Data[GS Diff],"<"&F2,GS_Data[GS Diff],">="&E2) which works fine on column F% and gives the answer 0.638 but I need it to work on column F H. If there was a Harmean IFS that would work but there isn't so I thought of averageifs 1/FH but that's not a valid range ...


Thanks.



F HF %GS DiffLowerUpper
2.350.43252.20100.00150.00
1.770.56187.43
1.930.52168.340.638
1.450.69178.69
1.360.74100.99
3.280.30181.57
2.000.50193.14
4.690.2185.00
1.720.58193.75
1.490.67141.04
5.750.17167.17
1.930.52102.63
2.220.45118.48
2.170.4683.61
1.230.81116.33
1.650.6115.39
2.130.47295.95
1.780.56193.01
4.290.2362.53
 
Upvote 0
Change the average column from F% to F H:
=AVERAGEIFS(GS_Data[F H],GS_Data[GS Diff],"<"&F2,GS_Data[GS Diff],">="&E2)
Does it work?
 
Upvote 0
That just gives the average of F H which is not what I want. I want the average of 1/F H i.e. the reciprocal of F H which is what I've shown in F %. Put another way I want the harmonic mean of F H between the upper and lower ranges. Thanks.
 
Upvote 0
OK, Got it. AVERAGE(IF,IFS) does not support array from formula (1/range). Try sum/count instead:
VBA sample.xlsx
ABCDEF
1F HGS DIFFLowerUpper
22.35120100150
31.77187.43
41.93168.340.557594
51.45110
Sheet2
Cell Formulas
RangeFormula
E4E4=SUMPRODUCT((C2:C5>=E2)*(C2:C5<=F2)/A2:A5)/SUMPRODUCT((C2:C5>=E2)*(C2:C5<=F2))
 
Upvote 0
Solution
Whoohoo! Thank you - that's exactly what I wanted. I've been struggling with this for some time now. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,215,016
Messages
6,122,700
Members
449,092
Latest member
snoom82

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