Column with formula to be edited when user selects "custom"

I'm new to AppSheets and this forum. I'm wondering if it's possible for the value of a column to be the result of a formula, which includes an option to be editable by the user.

I have a filterdate table, with three columns, Filter (enum), Start (Date), End (Date). Right now, upon selection of the Filter value (All Dates, This Month, This Year, Last Month, Last Year), a formula calculates the value for Start and End.

Screen Shot 2023-01-30 at 3.54.42 PM.png

The formula for Start looks like this

 

IFS(
([Filter] = "All Dates"),  MIN(transactions[Date]),
([Filter] = "This Month"), EOMONTH(TODAY(), -1) + 1,
([Filter] = "This Year"),  DATE(CONCATENATE("01/01/",YEAR(TODAY()))),
([Filter] = "Last Month"), EOMONTH(TODAY(), -2) + 1,
([Filter] = "Last Year"),  DATE(CONCATENATE("01/01/",YEAR(TODAY())-1))
)

It all works fine, but I wanted to add an option "Custom" to allow the user enter Start and End date fields.

Is that possible? 

0 5 94
5 REPLIES 5

Set the expression in the Initial Value of the column.

Users can change it if they want to.

Thank you for the suggestion. Setting the expression in the Initial Value of the column does not do what I want. When the user selects from the dropdown different options, the value of Start does not change. It seems the Initial Value is exactly that, only an initial value, not a value that changes upon changes on another column, which is what I want.

Other ideas?

Initial value DOES change based on the value of other table(s) if you have the right expression.  See here.

Thank you for the link. The detailed explanation states why it won't work in my case. The Initial Value expression only works for the first time a record is created, not when the record is being edited. "An Initial value expression assigns an initial or default values for a column in a new entry. ... Its value will be recomputed as the new entry is filled in until the user explicitly sets the value of the column. At that point, a value has been assigned and the Initial value definition is no longer relevant for this entry."

What I have is a user setting that is only editable, there will never be a new record. 

Thanks for the clarification. I've found a work around. I'm adding the filter elsewhere.

Glad you found a work around.

JFYI, there is also an option Reset on Edit that could have worked for you.

Top Labels in this Space