Average 3 months score before and after

datastudent

New Member
Joined
Sep 7, 2021
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to get the 3 months average score of before and after training. I got the after training but I'm having trouble with the before training.

Column AC highlighted in yellow shows the expected results. The 3 months average score of before TR should be calculated from the training date plus 2 months prior.
Incumbent Dashboard 2023 (version 3).xlsx
AVWXACADAGAHAIAJAKALAMANAOAPAQAR
2ConcatTR DateTR YearTR MonthBeforeTRScore22AfterTRScore22Jan22'Feb22'Mar22'Apr22'May22'Jun22'Jul22'Aug22'Sep22'Oct22'Nov22'Dec22'
3asdf8/23/20222022Aug22'9.379.968.99.49.910.010.010.08.0
4ghjk7/12/20222022Jul22'2.861.985.22.84.03.62.90.42.03.64.54.7
5lzxc11/8/20222022Nov22'9.658.007.98.69.29.39.79.98.0
Sheet1
Cell Formulas
RangeFormula
AD3:AD5AD3=IFERROR(AVERAGE(OFFSET($A3,0,MATCH($X3,$2:$2,0)):OFFSET($A3,0,MATCH($X3,$2:$2,0)+2)),"")
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
try this
Book1
AVWXADAEAHAIAJAKALAMANAOAPAQARAS
1ConcatTR DateTR YearTR MonthBeforeTR Score22AfterTR Score22Jan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22Dec-22
2asdf8/23/20222022Aug-229.379.968.99.359.879.959.979.968
3ghjk7/12/20222022Jul-222.861.985.152.823.973.642.860.3523.64.534.66
4lzxc11/8/20222022Nov-229.658.007.888.69.189.339.699.928
Sheet1
Cell Formulas
RangeFormula
AD2:AD4AD2=AVERAGE(IF(INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0))<0,"",INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0))),IF(INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)-1)<0,"",INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)-1)),IF(INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)-2)<0,"",INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)-2)))
AE2:AE4AE2=AVERAGE(IF(INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)+1)<0,"",INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)+1)),IF(INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)+2)<0,"",INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)+2)),IF(INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)+3)<0,"",INDEX($AH2:$AX2,MATCH(DATE(YEAR($X2),MONTH($X2),1),$AH$1:$AX$1,0)+3)))
 
Upvote 1
Some shorter options:

Book2
AVWXACADAGAHAIAJAKALAMANAOAPAQAR
2ConcatTR DateTR YearTR MonthBeforeTRScore22AfterTRScore22Jan22'Feb22'Mar22'Apr22'May22'Jun22'Jul22'Aug22'Sep22'Oct22'Nov22'Dec22'
3asdf8/23/20222022Aug22'9.379.968.99.359.879.959.979.968
4ghjk7/12/20222022Jul22'2.861.985.152.823.973.642.860.3523.64.534.66
5lzxc11/8/20222022Nov22'9.658.007.888.69.189.339.699.928
Sheet1
Cell Formulas
RangeFormula
AC3:AC5AC3=AVERAGE(OFFSET(AE3,0,MATCH(X3,AE$2:AR$2,0)-3,,3))
AD3:AD5AD3=AVERAGE(OFFSET(AE3,0,MATCH(X3,AE$2:AR$2,0),,3))
 
Upvote 1
Solution

Forum statistics

Threads
1,215,694
Messages
6,126,253
Members
449,305
Latest member
Dalyb2

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