Forum Discussion
Formula changes when a row is inserted
- Jan 30, 2022
Change the formula in J2 to
=SUMPRODUCT([Carbs]*([Date]=[@Date]))
or better, to
=SUMIF([Date],[@Date],[Carbs])
and fill down.
Change the formula in J2 to
=SUMPRODUCT([Carbs]*([Date]=[@Date]))
or better, to
=SUMIF([Date],[@Date],[Carbs])
and fill down.
- HansVogelaarJan 30, 2022MVP
When data are formatted as a table, you can use so-called structured references.
In a formula in the table itself, you can refer to all data rows in a column as [ColumnName].
For example [Date] refers to A2:A49, but if you insert a row in the table, [Date] will refer to A2:A50.
And you can use [@ColumnName] to refer to the cell in the specified column in the same row as the cell with the formula.
For example in J2, [@Date] refers to A2 and in J10, [@Date] refers to A10.
See the attached version of the workbook. Try inserting a new row in the table.
- wcstarksJan 30, 2022Iron ContributorI just downloaded your revision of the book and I see it works fine. Why did my modification in my version not work correctly, while it does in your version?
- HansVogelaarJan 30, 2022MVP
I don't know - I'd have to see your revision of the workbook.