I am trying to lookup the Location of an employee and their Manager from the most recent month (largest month number) in a particular Quarter. So, if I know the name of the employee and the quarter I'm looking up, the results should display who their last manager was and the location they were in, as these may change month to month.
I have used an INDEX & MATCH array formula:
<code>{=INDEX($B$2:$B$7,MATCH(A12,IF($D$2:$D$7=D12,$A$2:$A$7),0))}</code>
but this just provides the first match and not necessarily the most recent month in that quarter. I attempted to include a MAX function which looked something like this:
<code>{=INDEX($B$2:$B$7,MAX($E2:$E7,MATCH(A12,IF($D$2:$D$7=D12,$A$2:$A$7),0)))}</code>
but that didn't quite get me there either.
What formula do I need to get this to work?
Below is the Monthly Data
<tbody>
</tbody>
Below is the Quarterly Data (Location and Manager fields are blank),
I have the answers completed as to what the results should be. FYI: The month is not necessarily in Ascending or Descending order, hence to needing to find the highest value of month.
<tbody>
</tbody>
I have used an INDEX & MATCH array formula:
<code>{=INDEX($B$2:$B$7,MATCH(A12,IF($D$2:$D$7=D12,$A$2:$A$7),0))}</code>
but this just provides the first match and not necessarily the most recent month in that quarter. I attempted to include a MAX function which looked something like this:
<code>{=INDEX($B$2:$B$7,MAX($E2:$E7,MATCH(A12,IF($D$2:$D$7=D12,$A$2:$A$7),0)))}</code>
but that didn't quite get me there either.
What formula do I need to get this to work?
Below is the Monthly Data
Name | Location | Manager | Quarter | Month |
Ryan Smith | Sioux Falls | Rick James | 3 | 7 |
Jane Doe | Tampa | Bobby Brown | 3 | 7 |
John Rogers | Tampa | Tracy Lane | 3 | 7 |
Ryan Smith | Sioux Falls | Rick James | 3 | 8 |
Jane Doe | Denver | Thomas Craig | 3 | 8 |
John Rogers | Tampa | Cody Davis | 3 | 8 |
<tbody>
</tbody>
Below is the Quarterly Data (Location and Manager fields are blank),
I have the answers completed as to what the results should be. FYI: The month is not necessarily in Ascending or Descending order, hence to needing to find the highest value of month.
Name | Location | Manager | Quarter |
Ryan Smith | ans.(Sioux Falls) | ans.(Rick James) | 3 |
Jane Doe | ans.(Tampa) | ans.(Bobby Brown) | 3 |
John Rogers | ans.(Tampa) | ans.(Tracy Lane) | 3 |
<tbody>
</tbody>