How to AVERAGEIF Max of 2 columns values per row

gcefaloni

Board Regular
Joined
Mar 15, 2016
Messages
119
Hi, I'm trying to find a way of doing an average of the last column (assuming the max column isn't there). So averageif (max 2 values per row) for the entire range assuming that the result of the max isn't 0. So averageif NOT 0 and the max of the 2 values of Yield to maturity column and 12 month yield column for the entire range in a single cell. How can I do this? I'm trying to replicate the 3.43 figure at the bottom right of the array with the data I attached. THank you!!
NameYield to Maturity12 Mo YieldMAX
ABF Pan Asia Bond Index2.772.77
AdvisorShares Newfleet Mult-Sect Inc ETF2.952.522.95
Amundi ETF Floating Rate USD Corp USD0.00
Amundi ETF Floating Rate USD Corp USD0.000.00
Amundi ETF Global Emerg Bd Markit iBoxx0.00
Amundi ETF Global Emerg Bd Markit iBoxx0.000.00
Amundi IS Barclays US Corp BBB 1-5 ETFDR2.342.34
BMO Aggregate Bond ETF2.393.043.04
BMO Discount Bond ETF2.272.082.27
BMO Emerging Markets Bd Hdgd to CAD ETF4.344.654.65
BMO Floating Rate High Yield ETF4.714.71
BMO High Yield US Corporate Bond ETF0.00
BMO High Yld US Corp Bd Hdgd to CAD ETF5.665.555.66
BMO Laddered Preferred Share ETF4.114.11
BMO Long Corporate Bond ETF3.934.214.21
BMO Long Federal Bond ETF2.353.053.05
BMO Long Provincial Bond ETF3.153.513.51
BMO Mid Corporate Bond ETF3.013.103.10
BMO Mid Federal Bond ETF2.042.122.12
BMO Mid Provincial Bond ETF2.432.992.99
AVERAGEIF NOT 03.43

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
If the two columns are B2:B21 and C2:C21 you can use this array formula

=AVERAGE(IF(B2:B21>C2:C21,B2:B21,IF(C2:C21<>0,C2:C21)))

confirm with CTRL+SHIFT+ENTER

I get 3.43 with your data
 
Upvote 0
Another approach might be to use LARGE() in Barry's suggestion. You would probably still need to make it an array formula...=large(if(range=name) etc
 
Upvote 0
Thank you guys, is it possible to do that formula within a Pivot Table? As in a calculated field.
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,012
Members
449,060
Latest member
LinusJE

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