Average Multiple Table Columns if between Two Dates

jessebh2003

Board Regular
Joined
Feb 28, 2020
Messages
71
Office Version
  1. 365
Platform
  1. Windows
I have been racking my brain and searching the internet for a solution to no avail. Hopefully, someone may know an answer.

I'm trying to calculate the average of nine columns but only if the value falls within a date range. The below table is abbreviated for demonstration purposes as the actual table has almost 30,000 rows.

EvalResults.xlsx
EGHIJKLMNO
1SubmissionDateTheContentWasRelevantToMyWorkThisEventProvidedMeWithNewInformIIntendToUseWhatILearnedFromThisfacultyknowledgeablefacultyeffectivefacultyresponsivefacultyorganizedOverallTheConferenceWasFreeOfBiaTheLearningEnvironmentWasConduci
21/1/2021 0:48
31/1/2021 0:4844
41/1/2021 0:4844
51/1/2021 6:42
61/1/2021 6:4254
71/1/2021 6:4254
81/1/2021 9:48
91/1/2021 9:4844
101/1/2021 9:4844
Data


Here's what I've tried:

For reference - Year is a drop down in E1, and Jan is the month in E2 with Feb in G2, Mar in I2, etc.

1. Using AVERAGEIFS and CHOOSE - Populates #Value to a lot of cells
Excel Formula:
=AVERAGEIFS(CHOOSE({1,2,3,4,5,6,7,8,9},Table13[TheContentWasRelevantToMyWork],Table13[ThisEventProvidedMeWithNewInform],Table13[IIntendToUseWhatILearnedFromThis],Table13[facultyknowledgeable],Table13[facultyeffective],Table13[facultyresponsive],Table13[facultyorganized],Table13[OverallTheConferenceWasFreeOfBia],Table13[TheLearningEnvironmentWasConduci]),Table13[SubmissionDate],">="&DATE(Year,Jan,1),Table13[SubmissionDate],"<="&DATE(Year,Dec,31))

2. Using a Name Range - Returns a 0 value (ROL12CME references able13[TheContentWasRelevantToMyWork], Table13[ThisEventProvidedMeWithNewInform], Table13[IIntendToUseWhatILearnedFromThis], Table13[facultyknowledgeable], Table13[facultyeffective], Table13[facultyresponsive], Table13[facultyorganized], Table13[OverallTheConferenceWasFreeOfBia], Table13[TheLearningEnvironmentWasConduci])
Excel Formula:
=IFERROR(AVERAGEIFS(ROL12CME,Table13[SubmissionDate],">="&DATE(Year,Jan,1),Table13[SubmissionDate],"<="&DATE(Year,Dec,31)),0)

3. Using SUM, INDEX and FREQUENCY with and without a Name Range - Both returns an alert, "You've entered too few arguments for this function."
Excel Formula:
=IFS((SUM(Table13[TheContentWasRelevantToMyWork],Table13[ThisEventProvidedMeWithNewInform],Table13[IIntendToUseWhatILearnedFromThis],Table13[facultyknowledgeable],Table13[facultyeffective],Table13[facultyresponsive],Table13[facultyorganized],Table13[OverallTheConferenceWasFreeOfBia],Table13[TheLearningEnvironmentWasConduci])/INDEX(FREQUENCY((Table13[TheContentWasRelevantToMyWork],Table13[ThisEventProvidedMeWithNewInform],Table13[IIntendToUseWhatILearnedFromThis],Table13[facultyknowledgeable],Table13[facultyeffective],Table13[facultyresponsive],Table13[facultyorganized],Table13[OverallTheConferenceWasFreeOfBia],Table13[TheLearningEnvironmentWasConduci]),0),2)),Table13[SubmissionDate],">="&DATE(Year,Jan,1),Table13[SubmissionDate],"<="&DATE(Year,Dec,31)
Excel Formula:
=IFS((SUM(ROL12CME)/INDEX(FREQUENCY((ROL12CME),0),2)),Table13[SubmissionDate],">="&DATE(Year,Jan,1),Table13[SubmissionDate],"<="&DATE(Year,Dec,31)

Appreciate any help, ideas or suggestions. Thanks!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Just a food for thought - By any chance have you thought about or tried

SUMIFS/COUNTIFS - That shall be the average
 
Upvote 0
I haven't. Can you say more?
See you can SUMIFS a range of adjacent columns based on Criteria(s)

COUNTIFS not sure you have check individual columns or you can count for a range of adjacent columns. But it can be calculated.

Either ways at most two helper cells and average can be found, if populating all above gets messy in a cell.
 
Upvote 0
See you can SUMIFS a range of adjacent columns based on Criteria(s)

COUNTIFS not sure you have check individual columns or you can count for a range of adjacent columns. But it can be calculated.

Either ways at most two helper cells and average can be found, if populating all above gets messy in a cell.
Maybe I'm doing something wrong. I'm getting the alert about too few arguments.

Excel Formula:
=SUMIFS(Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]],">="&DATE(Year,Jan,1),Table13[SubmissionDate],"<="&DATE(Year,Dec,31))/COUNTIFS(Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]],Table13[SubmissionDate],">="&DATE(Year,Jan,1),Table13[SubmissionDate],"<="&DATE(Year,Dec,31))
 
Upvote 0
You cannot use any of the xxxIFS function like that, all the ranges must be the same size.
Try
Excel Formula:
=SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]])*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate],"<="&DATE(Year+1,Jan,1)))/SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]]<>"")*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate],"<="&DATE(Year+1,Jan,1)))
 
Upvote 0
You cannot use any of the xxxIFS function like that, all the ranges must be the same size.
Try
Excel Formula:
=SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]])*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate],"<="&DATE(Year+1,Jan,1)))/SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]]<>"")*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate],"<="&DATE(Year+1,Jan,1)))
Hi Fluff,
Thanks. That returned the alert, "There's a problem with this formula. Not trying to type a formula?..."
 
Upvote 0
Oops, it should be
Excel Formula:
=SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]])*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate]<DATE(Year+1,Jan,1)))/SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]]<>"")*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate]<DATE(Year+1,Jan,1)))
 
Upvote 0
Oops, it should be
Excel Formula:
=SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]])*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate]<DATE(Year+1,Jan,1)))/SUMPRODUCT((Table13[[TheContentWasRelevantToMyWork]:[TheLearningEnvironmentWasConduci]]<>"")*(Table13[SubmissionDate]>=DATE(Year,Jan,1))*(Table13[SubmissionDate]<DATE(Year+1,Jan,1)))

That's giving me a #VALUE! result.
 
Upvote 0
Do you have any text values in the table, or formulae that return ""
 
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