I can get the value from the last filled cell (LOOKUP(2,1/(D:D<>""),D:D)) and the row number of the last filled cell (LOOKUP(2,1/(D:H<>""),ROW(D:H))), but I don't know how to, for example, SUM(DLastRowNumber:DLastRowNumber-10). I was tinking a variable equal to the number of rows I need but I don't know how to implement it in a cell reference.

If there is another solution, I'm all for it. I'd rather a formula, but a macro or function is fine. FYI, I'm a VBA newbie.

Thanks in advance.