Using the difference between dates in an IF statement

I have a column the calculates the number of days between 2 dates, which is fine.
=[Arch Prelims]@row - [FP Arch Engagement ]@row (gives me a number)
But I don't want to do the calculation if the difference is a negative number. There are few instances where the result would be a negative number (very few) I don't want to include values for negative numbers. I tried using an IF statement results in a #UNPARSEABLE error.
=IF([Arch Prelims]@row -[FP Arch Engagement]@row > 0, [Arch Prelims]@row - [FP Arch Engagement]@row, 0)
both of the fields are Dates.
Help!
Best Answers
-
Hello @MarkCep,
You could have a formula that said if [Arch Prelims]@row - [FP Arch Engagement ]@row is less than zero, show blank else, [Arch Prelims]@row - [FP Arch Engagement ]@row. I think that would give you what you are looking for.
=IF([Arch Prelims]@row - [FP Arch Engagement]@row < 0, "", [Arch Prelims]@row - [FP Arch Engagement]@row)
I hope that is helpful to you in some way,
Protonsponge
-
@MarkCep, the second formula should work (having tested it) - is it down to the FP Arch Engagement in the first (working) formula having a space at the end of the column and the second formula not?
Answers
-
Hello @MarkCep,
You could have a formula that said if [Arch Prelims]@row - [FP Arch Engagement ]@row is less than zero, show blank else, [Arch Prelims]@row - [FP Arch Engagement ]@row. I think that would give you what you are looking for.
=IF([Arch Prelims]@row - [FP Arch Engagement]@row < 0, "", [Arch Prelims]@row - [FP Arch Engagement]@row)
I hope that is helpful to you in some way,
Protonsponge
-
@MarkCep, the second formula should work (having tested it) - is it down to the FP Arch Engagement in the first (working) formula having a space at the end of the column and the second formula not?
-
Thank you, both answers helped solve the issue.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.2K Get Help
- 452 Global Discussions
- 155 Industry Talk
- 505 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 81 Community Job Board
- 514 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!