Grid price calculation formula works weird

Formula
(a(Net price)+Net price)/2+0.0045+0.0365+0.0105+0.00145)*1.22

abs() used becouse negative price must be calculatet as 0 and not reduce grid delivery price

The same formula in excel working properly

=((ABS(B2)+B2)/2+0,0045+0,0365+0,0105+0,00145)*1,22

|datetime|kwh/c|price|

|2024-08-10 10:00:00+03|-0,028000|0,06|
|2024-08-10 11:00:00+03|-0,300000|0,06|
|2024-08-10 12:00:00+03|-1,000000|0,06|
|2024-08-10 13:00:00+03|-1,001000|0,06|
|2024-08-10 14:00:00+03|-1,000000|0,06|
|2024-08-10 15:00:00+03|-0,992000|0,06|
|2024-08-10 16:00:00+03|-1,001000|0,06|
|2024-08-10 17:00:00+03|-0,609000|0,06|
|2024-08-10 18:00:00+03|0,000000|0,06|
|2024-08-10 19:00:00+03|3,517000|4,36|
|2024-08-10 20:00:00+03|11,441000|14,02|

You are missing a parenthesis in the first formula, at the beginning.

1 Like

yes, you are right

But UI say all is ok

Another question

The selling price cannot be negative (only 0 if it negative), but I could not make a suitable formula due to restrictions (cannot be divided by net price). What can you advise in this case?

If you take a look at the first part of the formula posted second time, then there is a difference compared with Excel.
Excel: (ABS(B2)+B2)/2
UI: ABS((price) + price)/2
First will give you the value of the price, if price is positive, or 0 (zero) if price is negative
Second will always give you the absolute value of the price, no matter if the price is positive or negative
For the UI formula, move the first parenthesis after the ABS in front of the ABS function.
Must be something like this:

1

yes, that’s right, but there is an extra bracket in the original formula and VRM does not see the error

1 Like

Which bracket ?
Make the below modification as indicated in the previous post…

1

in my first formula the last closing bracket is unnecessary, but it says that the formula is correct. I have already corrected everything. thanks

P.S I mean that the validator on the site did not notice the problem