Do I use AVERAGEIF or AVERAGEIFS ???

JohnZ1156

Board Regular
Joined
Apr 10, 2021
Messages
180
Office Version
  1. 2021
Platform
  1. Windows
I'm trying to get the average interest rate YTD based on the date in column A.
I have many more months and years in the spreadsheet besides only 2023.
If the month and year in column A is 2023, for example, average all the months with interest greater than 0.
NOTE: There are formulas for future months that right now return Zero.

I tried both AVERAGEIF and AVERAGEIFS and I'm getting #DIV/0!
Obviously, I'm doing something wrong.
 

Attachments

  • Screenshot 2023-10-25 080952.jpg
    Screenshot 2023-10-25 080952.jpg
    64.2 KB · Views: 17

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try this:
Excel Formula:
=AVERAGEIFS(B5:B16,A5:A16,">=1/1/2023",A5:A16,"<=12/31/2023")
 
Upvote 0
Yes, but that is including Oct., Nov., and Dec. in the average.
I'm only looking for the average YTD.

The average for Jan. - Sept. is 1.49%.
By including the whole year, your formula returns 1.11%.

The formula should include the average percentage for cells in that year not including any percentages that = zero.
 
Upvote 0
Yes, but that is including Oct., Nov., and Dec. in the average.
I'm only looking for the average YTD.

The average for Jan. - Sept. is 1.49%.
By including the whole year, your formula returns 1.11%.

The formula should include the average percentage for cells in that year not including any percentages that = zero.
Then simply add another condition to only includes values not equal to zero, i.e.
Rich (BB code):
=AVERAGEIFS(B5:B16,A5:A16,">=1/1/2023",A5:A16,"<=12/31/2023",B5:B16,"<>0")
 
Upvote 1
Solution
Hey Joe4,
Thanks, that seems to work fine. I was trying add another condition that said to omit percentages that were "<=" zero.
I did modify your formlla however,
=AVERAGEIFS('Sheet1'!F:F,'Sheet1'!A:A,">="&DATE(YEAR(TODAY()),1,1),'Sheet1'!A:A,"<="&DATE(YEAR(TODAY()),12,31),'Sheet1'!F:F,"<>0")
Thank you !!!
 
Upvote 0
You are welcome. Glad I was able to help!
Nice job figuring out how to apply it to the current year dynamically!
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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