After some fiddling, here is a solution for the available rooms with the accompanying comments.
In the database, separate the comment numbers with a ; and try this formula:There is virtually no limit to the number of possible comments.![]()
=LET( f,FILTER(Database!B2:U88,ISNUMBER(XMATCH(Database!A2:A88,B4:J4))), t,VSTACK(Database!B1:U1,f), u,FILTER(t,BYCOL(t,LAMBDA(c,ISNA(XMATCH("No",c))))), r,TAKE(u,1), z,TRANSPOSE(FILTER(r,r<>0)), IFERROR( MAP(z,LAMBDA(x,LET(q,IFERROR(SORT(--UNIQUE(TEXTSPLIT(TEXTJOIN(";",,INDEX(u,,1+XMATCH(x,r))),,";"))),""),x&IF(INDEX(q,1)<>"",", "&TEXTJOIN(", ",,XLOOKUP(q,Database!X4:X14,Database!Y4:Y14,"")),"")))), "No rooms available"))
Bookmarks