Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Calculating cost through IS_BEFORE/AFTER & DATETIME_PARSE

Topic Labels: Formulas
287 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I have a product the changes cost frequently and I want to track this cost change in one field. This original formula has been working for me but now I am trying to figure out how to calculate the cost between two dates.

For example:

  • Cost before 1/1/2020
  • Cost between 1/1/2020 - 1/1/2021
  • Cost after 1/1/2021

IF({Date},
IF(IS_BEFORE({Date},
DATETIME_PARSE( ‘1/1/2020’,’’)),
VALUE({Product}) * 0.62))
+
IF({Date},
IF(IS_AFTER({Date},
DATETIME_PARSE(‘12/31/2019’,’’)),
VALUE({Product}) * 0.53))
+
IF({Date},
IF(IS_BEFORE({Date},
DATETIME_PARSE(‘1/1/2021’,’’)),
VALUE({Product}) * 0.53))
+
IF({Date},
IF(IS_AFTER({Date},
DATETIME_PARSE(‘12/31/2020’,’’)),
VALUE({Product}) * 0.48))

1 Reply 1

bumping this post :slightly_smiling_face: