Preserving data during a Sort

A have a nutrition speadsheet with basic ingredients in the top section and meals (that pull in data from these ingredients) below. If I do a Sort on the ingredients the new ingredients line numbers don’t get reflected into the meals. Is there a way around this?

I’d say the usual way is to “find” the right line/record via VLOOKUP()

Are you adding new ingredients below the top section? If yes, I suggest to insert new lines in the top section, and add the new ingredients there.

Can you share a reduced sample file? At least three ingredients, and a meal with two. Thanks.
Please, edit your question to add more information (or the sample file). Don’t use Answer nor Sugges a solution.