Average for given period

Muthukrishnan V

Active Member
Joined
May 29, 2008
Messages
297
Office Version
  1. 365
Platform
  1. Windows
Excel 2007


Column A contains dates in dd-mm-yyyy format.
Continuous dates like 07-08-2019, 08-08-2019, 09-08-2019 and so
on.


Column B contains numbers (round numbers) in numericals.



I have a helper column dd-mm-yyyy in E5 for Start Date and
E6 for End Date



My requirement: To get average of numbers in Column B for the
given period E5 to E6.


Request formula, Thanking you,
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
One way is to use a SUMIFS formula to sum all the values that fall into that date range, and then divide by a COUNTIFS formula that counts all the values that fall into that date range, i.e.
Code:
=SUMIFS(B:B,A:A,">=" & E5,A:A,"<="&E6)/COUNTIFS(A:A,">=" & E5,A:A,"<="&E6)
 
Last edited:
Upvote 0
You could also use Averageifs

=AVERAGEIFS(B:B,A:A,">="&E5,A:A,"<="&E6)
 
Upvote 0
You could also use Averageifs

=AVERAGEIFS(B:B,A:A,">="&E5,A:A,"<="&E6)
I keep forgetting about that one - and it is a little simpler!
 
Upvote 0
I get #Div/0!
That usually means that no records meet your criteria, so it is trying to divide by 0, which is not possible.
If you like, you can "hide" that error message by wrapping it in an IFERROR function, i.e.
Code:
[COLOR=#333333]=IFERROR(AVERAGEIFS(B:B,A:A,">="&E5,A:A,"<="&E6),"")[/COLOR]
would return a blank while
Code:
[COLOR=#333333]=IFERROR(AVERAGEIFS(B:B,A:A,">="&E5,A:A,"<="&E6),0)[/COLOR]
would return 0.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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