Average for month

Muthukrishnan V

Active Member
Joined
May 29, 2008
Messages
276
Office Version
  1. 365
Platform
  1. Windows
Office 365

Average for Month

Cell G9 contains Jun-2020 in MMM-YYYY
Column A contains dates in DD-MM-YYYY
Column B contains amount in whole number

To find out average for the month, I use the formula in H9:
=Averageifs(B:B,A:A,">="&G9,A:A,"<="&G9,0))
The result is #DIV/! since Jun-2020 onwards are future months.

Kindly advise me formula to show the average as blank for future months

Thanking you
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Why do you have a 0 as an argument at the end of the AVERAGEIFS function? Also, is G9 the date June 1, 2020 formatted as MMM-YYYY, or is it text?

I'd think you'd be able to use:

=AVERAGEIFS(B:B,A:A,">="&G9,A:A,"<="&DATE(YEAR(G9),MONTH(G9)+1,0))
 
Upvote 0
Hi, try like this instead.

=AVERAGEIFS(B:B,A:A,">="&G9,A:A,"<"&EDATE(G9,1))
 
Upvote 0
Hi, what exactly is in G9? Is it a date with formatting to only display the MMM-YYYY - in which case what exact date is it? Or is it text?
 
Upvote 0
=DAY(G9) in an empty cell shows Jan-1900.
The empty cell is : Format Cells - Category: custom - Type: mmm-yyyy
By way of additional information: Input in cell G9 is 01-06-2020. G9 shows: Jun-2020
Thank you Sir
 
Upvote 0
By way of additional information: Input in cell G9 is 01-06-2020.

That is the piece of information I was looking for. The suggested formula is sound.

You need to check that your dates in column A are actual dates and not text that looks like dates and that you actually have some dates in June 2020.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

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