Conditional look up multiple criteria then average

carlidee

New Member
Joined
Sep 15, 2020
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
Hi

I plan on having a master tab that I will continue to add data to over time. I'm looking to create a summary tab that show the most recent 3 week's average per employee. Please see example data below. I provided four dates below, but would only want the average to be the three most recent weeks.

Thank you!

EXAMPLE OF MASTER DATA SOURCE TAB
NameCountDate
Dave61/1/2021
Dave112/1/2021
Dave173/1/2021
Dave204/1/2021
Tim41/1/2021
Tim232/1/2021
Tim103/1/2021
Tim124/1/2021
Kate241/1/2021
Kate122/1/2021
Kate103/1/2021
Kate64/1/2021


EXAMPLE OF DESIRED OUTPUT ON ANOTHER TAB:

NameMost recent 3 weeks average
Dave
16​
Tim
15​
Kate
13​
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try:

Book1
ABCDEF
1NameCountDateNameMost recent 3 weeks average
2Dave65/31/2021Dave11.33333
3Dave115/24/2021Tim12.33333
4Dave175/17/2021Kate15.33333
5Dave205/10/2021
6Tim45/31/2021
7Tim235/24/2021
8Tim105/17/2021
9Tim125/10/2021
10Kate245/31/2021
11Kate125/24/2021
12Kate105/17/2021
13Kate65/10/2021
14
Sheet13
Cell Formulas
RangeFormula
F2:F4F2=AVERAGEIFS(B:B,A:A,E2,C:C,">="&TODAY()-21)


This just works on 3 weeks back from today. If you want to consider that a week starts on a Monday or some such thing, let me know.
 
Upvote 0
Solution
Try:

Book1
ABCDEF
1NameCountDateNameMost recent 3 weeks average
2Dave65/31/2021Dave11.33333
3Dave115/24/2021Tim12.33333
4Dave175/17/2021Kate15.33333
5Dave205/10/2021
6Tim45/31/2021
7Tim235/24/2021
8Tim105/17/2021
9Tim125/10/2021
10Kate245/31/2021
11Kate125/24/2021
12Kate105/17/2021
13Kate65/10/2021
14
Sheet13
Cell Formulas
RangeFormula
F2:F4F2=AVERAGEIFS(B:B,A:A,E2,C:C,">="&TODAY()-21)


This just works on 3 weeks back from today. If you want to consider that a week starts on a Monday or some such thing, let me know.
This should do the trick - thank you!!
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,031
Members
448,940
Latest member
mdusw

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