Compare three different input to get the average of two nearest value

Hi guys, Anyone know how to compare three different decimal inputs value and get the two nearest value? The example like below. Before this, user using excel VBA to get the nearest two values. By using this formula. How I can make in Mendix?
1 answers

This depends a bit on the setup you take in mendix.

But for example if every decimal input is a object with a decimal entity.
In a microflow you can then check:
1. Do a count of the number of objects
2. Use a split activity to check if the number of objects is 2
3. If it is 2 then do use an aggregate list activity to do an average of the objects
4. Use a split activity to check if the number is 3

  1. If it is 3 use the different calculation that you want(not sure what this is from your formula)