Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

If and DateAdd statement giving me an error

Topic Labels: Formulas
198 2
cancel
Showing results for 
Search instead for 
Did you mean: 

Ok so I am trying to use an if statement to put in a date but then if it doesn’t meet the condition I want it to be blank. I keep getting an error. Here is my formula: IF({Sample Status} = Out, (DATEADD({Date Checked Out},7,“days”)), BLANK())

Can anyone help?
Thanks

2 Replies 2

Hi @Dyanna_Garcia
You can just remove the BLANK() from your formula. You may also need to tell the formula that Out is a string by surrounding it in ‘’

IF({Sample Status} = 'Out', (DATEADD({Date Checked Out},7,'days')))

Hi @Dyanna_Garcia !
Assuming ‘Out’ is a a value and not a name of a field, then this should do it:

IF({Sample Status}='Out', DATEADD({Date Checked Out},7,'days'))

If ‘Out’ is a name of a field, then use this:

IF({Sample Status}={Out}, DATEADD({Date Checked Out},7,'days'))

You rarely need to use BLANK(). IF statements work as

IF({condition is true},
'do this',
'otherwise do that'
)

If you don’t require an output when conditions aren’t met, such as BLANK(), it’s preferable to leave the ‘otherwise do that’ part out entierly. It’s cleaner and helps prevent possible future issues with empty strings.

IF({condition is true},
'do this'
)