Return first cell in row if condition is met.

Copper Contributor

I'm not a pro in excel I'm just experimenting some formulas for a recipe organiser.

Basically, I want to return the recipe name of all recipes containing one specific ingredients, just one.

I've tried with Vlookup but it doesn't work since since the lookup value is not on the first row.

My table look like this:Screenshot 2022-05-02 at 21.57.32.png

Any ideas how can I make it possible?

Thanks!

2 Replies

@Gabitsu 

=TEXTJOIN(";",TRUE,IFERROR(INDEX(A2:A7,IF(MMULT(N(B2:E7=G2),ROW(1:4)^0)*ROW(1:6)>0,MMULT(N(B2:E7=G2),ROW(1:4)^0)*ROW(1:6),"")),""))

This works in my Excel online sheet. However it's only possible to apply this formula if you work with Office365 or 2021 or Excel online.

@OliverScheurich 

Thanks, but it's not working on my version of excel, I will investigate with INDEX+MATCH to see if I can crack the code :)) Thanks tho