You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pycel seems to return a value error if a NOT is applied to a range. Here is an example: =SUM(--NOT(Table1[b]))
This gives a #VALUE! error in pycel, I expected the summation of all the False elements, which is 3.
Alternatively, =SUM(--Table1[b]) returns the correct summation of all the True elements, which is also 3.
What was expected to happen
What is supposed to happen is that: Table1[b] returns a range -> NOT converts each element in that range to it's logical opposite (False, True, False, True, False, True) in this case -> -- is a typical Excel idiom to convert a boolean to a number (for True the first negative converts True to -1 and the second negative converts the -1 back to 1; for False it is converted to 0 and then to 0 again) -> SUM should then sum up all the 1 values to reach a total of 3.
What actually happened
Pycel seems to return a value error if a
NOT
is applied to a range. Here is an example:=SUM(--NOT(Table1[b]))
This gives a
#VALUE!
error in pycel, I expected the summation of all theFalse
elements, which is3
.Alternatively,
=SUM(--Table1[b])
returns the correct summation of all theTrue
elements, which is also3
.What was expected to happen
What is supposed to happen is that:
Table1[b]
returns a range ->NOT
converts each element in that range to it's logical opposite (False, True, False, True, False, True) in this case ->--
is a typical Excel idiom to convert a boolean to a number (for True the first negative converts True to -1 and the second negative converts the -1 back to 1; for False it is converted to 0 and then to 0 again) ->SUM
should then sum up all the1
values to reach a total of 3.Code Sample
your_workbook.xlsx
This prints:
Environment
Pycel Version b093fc5
The text was updated successfully, but these errors were encountered: