Need help returning multiple values to one cell based on a two criteria

Copper Contributor

I have multiple properties and at each property there are multiple tenants. I am trying to show all the tenants that have that date to show up in the one cell. With this formula I can only get one tenant to show up, not both. How do I get both tenants to show up in the cell.

Sheet 1

Property9/30/202210/31/2022
Property 1=iferror(xlookup($A2&B$1,'Sheet2'!$A$2:$A$7&'Sheet2'!$C$2:$C$7,'Sheet2'$B$2:$B$7),0) 
Property 2  
Property 3  

 

Sheet 2

PropertyTenantDate
Property 1Tenant 19/30/2022
Property 1Tenant 29/30/2022
Property 2Tenant 310/31/2022
Property 2Tenant 49/30/2022
Property 3Tenant 510/31/2022
Property 3Tenant 610/31/2022
2 Replies

@jmw24 

 

The FILTER function is what you need, and because it yields what's called a dynamic array, you need to put the different properties side by side, rather than vertically. I've attached one sample of how that could look. If you change the dates or property numbers in the orange background cells, the results will change to reflect your criteria.

 

The table on Sheet2 is a dynamic table, so you could add rows and see that the filter function on Sheet1 keeps up with you.

 

Here too is a good resource for learning about the FILTER function. (Oh, you will need a current version of Excel)

 

 

@jmw24 The final piece you're looking for is the TextJoin which, when combined with the filter function already mentioned, will return multiple values in a single cell as shown.    

 

=IFERROR(TEXTJOIN(" / ",,FILTER(Table3[Tenant],(Table3[Property]=$A2)*(Table3[Date]=B$1))),"")

DexterG_III_1-1663217959612.png

 

This and formula requires office 365 in order to work properly.  

 

Hope this helps. 

 

Dexter