0
votes

I am trying to figure a way to search based on a name in column A and date in column B what is the salary of that person. The salaries are in another worksheet, also split by the name in column A and date in column B and salary in column C.

I am doing this in Google Sheets.

Below is shown what I need.

Table 1:

Name Date Salary
John Smith 31/12/2020 $5,000
John Doe 31/12/2020 $4,500
John Smith 31/11/2020 $4,780

Table 2:

Name Date Salary
John Smith 31/12/2020 =formula here to find appropriate salary
3

3 Answers

0
votes

You can try QUERY() function in google sheet.

=QUERY(A2:C4,"Select C Where A='" & A9 & "' AND B='" & B9 & "'")

You can also use INDEX/MATCH() like

=ArrayFormula(INDEX(C2:C4, MATCH(A9&B9,A2:A4&B2:B4,0)))

enter image description here

0
votes

use:

=INDEX(IFNA(VLOOKUP(A2&B2, {'Table 1'!A:A&'Table 1'!B:B, 'Table 1'!C:C}, 2, 0)))

enter image description here

0
votes

In google sheets you can try:

=FILTER(C1:C3,A1:A3=E2,B1:B3=F2)

enter image description here