I'm trying to pull in unique text (invoice number) from a master list of data, but only if two criteria are met... I've been able to figure out how to pull in the data with one criteria (vendor name), but getting duplicate results. I haven't been able to figure out the correct formula to have it go to the next unique record. Also, i need to figure out how to add a second criteria (date and vendor) before it generates a result.

This is the formula that works to pull in one criteria.

=IF(ISERROR(INDEX('Master Invoice Entry'!$A:$R,SMALL(IF('Master Invoice Entry'!$B:$B='Memo Creator'!$B$17,ROW('Master Invoice Entry'!$A:$R)),ROW(2:2))-1,1)),"",INDEX('Master Invoice Entry'!$A:$R,SMALL(IF('Master Invoice Entry'!$B:$B='Memo Creator'!$B$17,ROW('Master Invoice Entry'!$A:$R)),ROW(2:2))-1,1))

The second criteria that needs to be met is 'Master Invoice Entry'!$C:$C='Memo Creator'!$N$9

So basically, if 'Master Invoice Entry'!$C:$C='Memo Creator'!$N$9 and 'Master Invoice Entry'!$B:$B='Memo Creator'!$B$1 are met, I want the formula to pull in an invoice number (but on the master invoice entry, some invoices have multiple lines)

Invoice Number Vendor Name Date
1234 DEF Company March 2018
1234 DEF Company March 2018
ABCD DEF Company March 2018
ABCD DEF Company March 2018
9876 DEF Company April 2018

So if the criteria were DEF company and March 2018 I would want two results, invoice 1234 and ABCD... but currently I'm getting all five lines, not just the two unique invoice numbers.

Help please!