"Minus Days" Is Generating "7 Days Ago" Instead of Adjusted Date

I have a reporting table with two date columns. When a new row is created, the first column is automatically populated with the date it was created. The row next to it is supposed to subtract 7 days from the first column’s date. However, now matter how I write the formula, I keep getting either: 12/23/1899 (same month, same day, but a year that is 124 years ago! Go figure!) OR literally “7 days ago”.

What’s wrong with my formula?



hi @Rai_Cornell ,

I am afraid I do not fully understand the issue.

you see that the empty rows provide as a trip to the past.

maye you can share a sample doc, may this not be of help.

by the way, I used the ‘calculate’ to get here, so first the column is set on date as data type and second I calculate in the column

cheers, Christiaan

Hey Christiaan,

Thanks for your help (again!)!

Here’s a visual of what’s happening:

Hey @Rai_Cornell

I think you’ve stumbled upon a cool little oddity with Coda that I’ve never seen before. I’ve managed to replicate the issue you’re facing and, oddly, it’s dependent on the order you created those specific columns.

What I think Coda does when you have some “value for new rows” set in your table, is it runs through those columns in the order they were created and populates their values. When I replicate your table in my own doc, if I create the column “Reporting On” before I create the column “Week Of”, then your formulas work as expected. However, if I create “Week Of” first, then your oddity pops up.

So my theory is that your “Week Of” column is trying to calculate a date based on “Reporting on”, but Coda just hasn’t populated that value yet.

Interesting!

Anyways, the solution is pretty simple in this case. Just change the “Week Of” formula for new rows from thisRow.Reporting On - Days(7) to Today() - Days(7). That way, it’s no longer dependent on “Reporting On” being populated.

Jono

2 Likes

Thank you so much, Jono!! This worked!

Christiaan’s suggestion of using the Calculate feature instead of the “Value for New Rows” feature also worked!

Thank you both so much :slight_smile:

1 Like