Help

Re: Can I use variables in formulas

3649 0
cancel
Showing results for 
Search instead for 
Did you mean: 
James_Samuel
6 - Interface Innovator
6 - Interface Innovator

I want to put the result of another field in place of [#] in the formula: DATEADD([date], [#], ‘units’)
I’ve tried enclosing the field name in [] {} () but nothing seems to work.

Am I missing something?

13 Replies 13
Tuur
10 - Mercury
10 - Mercury

Usually you don’t need 'm (only use when there are {spaces your field name}). And when you use the formula editor it will fix that for you. Simply pick the field from below and narrow it down by typing the first character(s) from the name.

Also, it shows examples in the editor. :slightly_smiling_face:

Thanks Tuur, I probably should have been more complete in my description: As well as trying [], {} and (), I tried it with just the field name, but to no avail. The only time this formula worked was if I inserted a specific number for [#]

I’ve had success using variables in other formula, just not this one:
DATEADD([date], [#], ‘units’)

Ah. In that case it could be a specific date related conversion thingy. :slightly_smiling_face:

I’ll have a closer look at it later…

No probs here when I use…

DATEADD(Datefield, Numberfield, 'day')

Thanks for testing this Tuur - I also keep trying but this formula field only returns the same date as the [Datefield] with an additional (unwanted) time stamp of 12:00am.

https://airtable.com/shrX2oVgmvKcDyXfE
The formula in NextDateDue field reads: DATEADD(JobDate, Frequency, ‘day’)

:slightly_smiling_face: It’s going to be fun when we get to the bottom of this one :slightly_smiling_face:

What happens when you change the format of {frequency} to drop the decimal point & zero?

Oh. Now I see that the field is not a number field. As lookups are handled differently (as arrays) that could be the problem. :slight_frown:

Yes, apparently the DATEADD formula will not accept a number from a Lookup or a Formula ONLY a Number field :frowning:

This is unfortunate, as the number I am wanting to reference is from another table. The only way around this is likely to involve copying from the lookup and pasting into a number field for every new record.

And what happens when you use the {freq} field?