# Discussions

View Only

## How to Calculate Fees Incurred Daily from [Date Received]

• #### 1.  How to Calculate Fees Incurred Daily from [Date Received]

Posted 09-06-2018 18:12
I'm looking for a more elegant formula to calculate fees incurred after a certain date, then daily up to 30 days. Below is what I've put together; is there a shorter way of expressing this?"
null)"

• #### 2.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Posted 09-06-2018 18:32
This reply was created from a merged topic originally titled How to Calculate Fees Incurred Daily from [Date Received].

I'm looking for a more elegant formula to calculate fees incurred after a certain date, then daily up to 30 days. Below is what I've put together; is there a shorter way of expressing this?
null)

• #### 3.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Top
Contributor
Posted 09-06-2018 18:38
Try this

var number DaysOverDue = ToDays(Today()-[Date Received];

If(\$DaysOverDue > 60, \$DaysOverDue - 60)

• #### 4.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Posted 09-06-2018 19:03
Thank you but it goes on indefinitely. The fee should start at 60 days after date received, incurring \$1 a day up to a max of 30 days (90 days after date received)?

• #### 5.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Top
Contributor
Posted 09-06-2018 19:09
No problem

var number DaysOverDue = Min(30, ToDays(Today()-[Date Received]);

If(\$DaysOverDue > 60, \$DaysOverDue - 60)

// the formula above will use the smaller of 30 and the # of days overdue.

• #### 6.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Posted 09-06-2018 19:22
Sorry, it's not giving me the calculation I'm looking for. Even added the ) to the
var number DaysOverDue = Min(30, ToDays(Today()-[Date Received]))

If(\$DaysOverDue > 60, \$DaysOverDue - 60)

• #### 7.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Posted 09-06-2018 19:23
var number DaysOverDue = Min(90, ToDays(Today()-[Date Received]));
If(\$DaysOverDue > 60, \$DaysOverDue - 60)

• #### 8.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Top
Contributor
Posted 09-06-2018 19:24
OK, Very good.

• #### 9.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Posted 09-06-2018 19:29
Thank you for your help good sir!

• #### 10.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Top
Contributor
Posted 09-06-2018 18:40
No If() needed:

• #### 11.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Top
Contributor
Posted 09-06-2018 18:45
I believe You still need the IF or else the days overdue will be initially negative.

• #### 12.  RE: How to Calculate Fees Incurred Daily from [Date Received]

Top
Contributor
Posted 09-06-2018 18:51
You are correct.