Google Sheets – How to Return Max Value Based on Two Conditions

formulasgoogle sheetsgoogle-sheets-arrayformulagoogle-sheets-datesvlookup

I've been reading through a lot of other solutions to similar problems but am not able to resolve my issues.

I have a Google Sheet with two sheets I am working with:

Sheet 1

A list of contacts (last name, first name, position, etc.) with column 18 (R) being a "last contact type" (phone call, meeting, etc. drop-down list, data validation) and column 19 (S) being a " last contacted date" column (data validation, date).

Sheet 2

A list of weekly interactions (last name, first name, position, etc.) with column 6 (F) being a "date" (data validation, date) column.

What I want to do

I need to build a formula for Sheet 1, column 19 (S), that returns the max date value from Sheet 2 in column 6 (F) IF Sheet 1 column 18 (R) is not null (I used ">0") AND Sheet 1 Column 1 (A, Last Name) equals Sheet 2, Column 1 (A, Last Name).

This would allow me to track when the last time I talked with my clients by keeping a weekly log of interactions.

Best Answer

=ARRAYFORMULA(IFERROR(VLOOKUP(A3:A, SORT(Interactions!A5:F, 6, 0), 6, 0)))

0