is it possible to have a dynamic range that is filled with formulas and expands/contracts depending on another range?

here's what i mean:

ranges x (data) and y (formulas) will be the same size. range x gets pasted in first, so it determines the size of the ranges. i want range y to automatically assume the correct size and fill each cell with the correct formula.

right now, i clear the ranges, paste in range x, then put in the formulas. of course, this takes time and slows down the calculation.

obviously, i can simplify everything by putting the formulas into the worksheet and never dealing with it in code, but i don't do this for two reasons: 1) it's a waste of memory, and 2) the ranges have to be the same size.

ideally, i'd like the formulas to already be in the worksheet, and when the range expands/contracts, only those cells that are within the range have the formula. is this possible?

thanks.