If and DateAdd statement giving me an error

Topic Labels: Formulas
674 2
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

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?

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')))
7 - App Architect
7 - App Architect

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'