Problem with logic calc ifThenElse and less than

Hello, I am trying to create a workflow that when filling in a series of data makes automatic calculations, but the formula is not working for me.

I have two date fields, the current one and a previous one: date1 and date 2, I have the days field that subtracts both dates, this one works but when i save, give a error500.

Now I want that value to be compared in a field:
if days is less than 365 it returns 100
if days is greater than 365 and less than 730 return 84
if days is greater than 730 and less than 1905 return 67

I used this:

{ifThenElse({lessThan({P2};365)};100;84)}

But it’s not running.

IIn the workflow I don’t know if different actions can be added that are carried out as the calculations are carried out as I want.
First it calculates days, then compares the days and returns a value.
Then I have to multiply that value with another field. etc…
Or it is better that you create a workflow for each calculation.

Is it possible to have them automatically calculated if you need to save? I imagine that they are already logic hooks, which I do not control.

I need a little help or if someone can do the logic hooks work, could you give me a quote?

I am not exactly sure what you are trying to do here but can you not use a logic hook before saving or create your own scheduled job?