Hi @DanGarTx,
Welcome to the DocuSign Community!
We are glad to have you here and can't wait to help share as much knowledge as possible.
I am sorry to hear that you have been experiencing issues with your formula, but I will help correct this behavior as soon as possible.
To fix your first formula (the one to calculate the total allowance for the first and last day of travel), you will need to first need to validate whether or not the dates are the same, prior to adding the total expense for day. For this scenario, you can use a formula similar to the following (DateDiff( Darrival] , adeparture])<> 0)) as a trigger field for the formula that will add up the total allowance for these days.
Once that is covered, you can set up a Conditional Rule for your formula, where you specify that the second formula should only be displayed if the trigger field’s answer is “1”. And if the answer to the trigger field is “0”, the rule should display a text box with the $41.25 total.
Regarding the issue with the second formula, the fact that you are getting a negative number leads me to believe that the date difference result is 0, causing the resulting -1 to be mutiplied by your $55.
In order to correct this issue, I would suggest first validating if your departure and arrival dates are the same through a separate formula, similar to the one used for the first scenario. With the result from this formula, you can trigger the appearance of the formula where you will substract the arrival and departure dates and multiply the total by 55.
Feel free to let us know if you need further assistance with this.
Thank you for using DocuSign, we hope you have a wonderful rest of your day!
Best regards,
Alejandro R. | DocuSign Community Moderator
Please click "Best Answer" below if you find my reply to be a valid solution to your issue!
I attached the error I got.
(DateDiff( [Return Date] , [Departure Date] )=> 1)* 55
What I need this to do is if the difference between the return date at the departure date is 2 or greater, then I need than I need the difference to multiply that number times $55?
1st and last date meal reimbursement is $41.25. The in-between meal reimbursement rate is $55.
Example: Travel is July 1 through July 4. The first formula need it to calculate:
July 1 $41.25
July 2 $55
July 3 $55
July 4 $41.25
For a grand total of $192.50 in meal reimbursements. If the travel were July1-3 then 1 less day of the $55 rate. If travel was July 1-5 then add $55, so on so forth.
If travel is taken July 1 and return July 2, then I need the formula to only add the first and last day of travel for a total of $82.50.
If travel is only for one day then we only need the meal reimbursement of $41.25.
1st and last date meal reimbursement is $41.25. The in-between meal reimbursement rate is $55. If travel is only 2 days then the in-between rate does not apply. If travel is only for a day, then only one the first date of meal reimbursement applies($41.25)
Hi @DanGarTx,
Thank you for following up.
I see that you were able to work this issue with a Technical Support Engineer through a support case.
According to their feedback, I understand that the formulas that worked for your use case were:
Total: if (DateDiff( fReturn Date] , ]Departure Date] )= 0,41.50,((DateDiff( fReturn Date] , ]Departure Date] )-1)*55)+82.50)
Same Day (Per Diem 1st/Last Day): if(DateDiff( fReturn Date] , ]Departure Date] ) =0,41.25,82.50)
Multi day (Per Diem Full Day): if(DateDiff( fReturn Date] , ]Departure Date] )>= 2, (DateDiff( fReturn Date] , ]Departure Date] )-1)*55,0
Please don't hesitate to let me know if you have any other questions or concerns and I will address them as soon as possible.
Best regards,
Alejandro R. | DocuSign Community Moderator
Please click "Best Answer" below if you find my reply to be a valid solution to your issue!