A couple of things:
- The SUM function is not required
- SUM(A+7) will sum all the values in column A and add 7 to it. If the formula is in column A, is a circular reference (the formula one of the cells being summed). Also, you cannot sum dates (for example, 4/1/24 + 4/2/24 makes no sense).
- Telling it to put the formula A2+7 into a cell means exactly that. It will not be A3+7 then A4+7, etc., only A2+7.
If you want the formula in the cell, you don't need a shortcut or script, you can enter the formula one time in the table and the new rows will get it. If A2 is a date, put the formula =A2+7 into cell A3. When you add a new row, the formula will populate to the new row automatically. All rows other than row 2 will be formulas.
If you want the cells to have the actual value of the row above +7, that takes a little more effort. To do what you want to do requires AppleScript. Run AppleScript is one of the actions available in Shortcuts. Use that action. Delete the default text and replace it with the text below (or a better script is someone has a better way to do it):
tell application "Numbers"
tell front document
tell active sheet
tell (first table whose selection range's class is range)
add row below last row
set value of cell 1 of last row to "=A" & ((address of last row) - 1) & "+7"
set value of cell 1 of last row to (value of cell 1 of last row)
end tell
end tell
end tell
end tell
The way I did it is kind of a strange way to add 7 to a cell but there is a reason I did it this way. First, I wanted it to work on any value that can have a 7 added to it in Numbers. Numbers does things differently than AppleScript. If I simply added 7 in the script, the result would be the previous date + 7 seconds, not 7 days. So I created the Numbers formula to add 7 to the previous value then I replace the formula with the value that was calculated. Note that, in Numbers, it will show that the cell contains the formula until you click off the cell then click back onto it andthen it will be the actual value.