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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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