The macro I have to add these formulas to already has a variable that determines the last row (max_row), so would I use that instead of the lastrow variable?

Also, wouldn't the "3" in the formulas need to be changed to a variable that references the each row somehow? I don't know how to do that.