was actually a little harder than i thought it was going to be
i transferred the main data sheet on sheet 2 and insert a helper row to get row header down to line level (column A)
after which i used the CSE formula (ctrl+shift+enter to get the {} around the formula)
Formula:
=IF(ISERROR(INDEX($B$3:$B$83,SMALL(IF(N$1=$A$3:$A$83,IF($E$3:$E$83>0,ROW($B$3:$B$83)-2)),ROW(1:1)))),"",INDEX($B$3:$B$83,SMALL(IF(N$1=$A$3:$A$83,IF($E$3:$E$83>0,ROW($B$3:$B$83)-2)),ROW(1:1))))
assumption i took was you cannot have more than 6 items per meal per day..this based on your previous template...if you want more you can just fill down the formulas
Bookmarks