Jul 25, 2018 12:30 PM
I have a table where I need to display the amount given (in field {amount} if it was given between particular two dates. Like 5/1/17-5/1/18 I’m at a total loss of how to do this.
Jul 25, 2018 03:18 PM
You can combine these functions:
Jul 25, 2018 04:10 PM
Thank you! Could you give me an example of how that might look? I’ve been playing with functions and I’m certain I’m not typing them right.
Jul 26, 2018 07:25 AM
Try first :grinning_face_with_sweat: If you don’t get it to work you can ask for help :winking_face:
PD: I almost gave you the formula, just read a little the docs
Jul 26, 2018 07:48 AM
Thanks for the encouragement! Over the last couple of days I’ve tried various modifications of this: If((IS_BEFORE({Date}, 5/1/2017)) AND (IS_AFTER({Date},5/1/2018)), Amount, 0). I am way out of my league in figuring out programing - generally I can find answers by looking through other posts, but I haven’t found one and I feel like I keep hitting my head against a brick wall.
Jul 26, 2018 08:27 AM
Hi Macie
Try this:
IF(AND(IS_AFTER({Date 1},‘5/1/2017’),IS_BEFORE({Date 1},‘5/1/2018’)),Amount,0)
Where you were going wrong with your example is the way AND works in Airtable - take a look at the documentation.
You may need to consider that IS_AFTER and IS_BEFORE are not inclusive (in other words Amount would not be displayed for 5/1/2017).
Jul 26, 2018 09:10 AM
Thank you, Thank you! I got it to work!
And thank you for the tip on it not being inclusive. I thought it was the case - but you firmed it up! Thanks again!
Jul 26, 2018 12:32 PM
5 is not after nor before 5. How they would be inclusive?
Jul 27, 2018 08:41 AM
As you don’t have something like IS_AFTER_OR_EQUAL or IS_BEFORE_OR_EQUAL the expression must be defined to consider an inclusive or exclusive IF by default.
That was @Macie_Smith clarification.
Rgds
Jul 27, 2018 12:49 PM
I understand his clarification (not yours BTW :grinning_face_with_sweat: ), but I see it as unnecessary. One day never could be after or before itself, it’s obvious. Of course a user could miss that and do a wrong comparison and he would love to know, but it’s not a trick, a tip, or a rule, it’s just logic. I don’t like to point that type of things, I think it confuses more than helps the users.
PD: Well, the functions could be programmed to include the same day but that would be too strange for me, I think that expect that the same day is not included is the natural and logic way of thinking.