pyExcelerator, formulas.py, 'IF(A1>A2' example

81 views
Skip to first unread message

chief...@gmail.com

unread,
Oct 30, 2008, 2:53:47 PM10/30/08
to python-excel, chief...@gmail.com
I just downloaded version 0.6.3a and ran formulas.py. There seems to
be a problem with the last example in the script.

That line says
ws.write(12, 3, Formula('IF(A1>A2;3;"hkjhjkhk")'))
When I view the cell (d13), the formula actually stored is
=IF(A1>=A2,3,"hkjhjkhk")
Notice that the relational comparison stored is not what the script
specified.

For a test I changed the line in the script to
ws.write(12, 3, Formula('IF(A1>=A2;3;"hkjhjkhk")'))
but when I ran the script I got the error
File "C:\Python25\Lib\site-packages\pyExcelerator-0.6.3a\examples
\formulas.py", line 48, in <module>
ws.write(12, 4, Formula('IF(A1>=A2;3;"hkjhjkhk")'))
File "c:\Python25\Lib\site-packages\pyExcelerator\ExcelFormula.py",
line 62, in __init__
raise Exception, "can't parse formula " + s
Exception: can't parse formula IF(A1>=A2;3;"hkjhjkhk")

This seems very strange to me. Is it true that
a) pyExcelerator formulae specified as "strictly greater than" are
implemented in Excel as "greater than or equal to", and therefore
b) pyExcelerator is not able to specify an Excel formula as "strictly
greater than"?

I am running Excel 2003 under Windows Vista 64.

Thanks.

Dan

John Machin

unread,
Oct 30, 2008, 4:51:23 PM10/30/08
to python...@googlegroups.com
On 31/10/2008 05:53, chief...@gmail.com wrote:
> I just downloaded version 0.6.3a

Don't do that. Excerpt of pyExcelerator chronology (look at the
sourceforge site for more details):
October 2005: that version released
February 2007: bugs (1) with > (2) with >= <= <> fixed in svn
March 2007: most recent activity

Consider http://pypi.python.org/pypi/xlwt

Cheers,
John


chief...@gmail.com

unread,
Nov 4, 2008, 2:33:28 PM11/4/08
to python-excel
Thanks, John. Had heard good things about xlrd, did not know there was
a xlwt. Will give it a try.
Best,
Dan

On 30 Oct, 12:51, John Machin <sjmac...@lexicon.net> wrote:
Reply all
Reply to author
Forward
0 new messages