Formulas containing =SUMIF(...) or =COUNTIF(...) and
others are not seen as formulas. Writing something like:
ws.write_formula([row, col], "=SUMIF(C12:C14, A1, D12:
D14)")
When you open the Excel-Spreadsheet (Excel 97)
containing the formula you will realize that the formula is
in a strange state. To activate the formula you have
bring it into edit-mode (press <F2>) and afterwards press
<Enter>. Afterwards Excel will recognize it as a formula...
but before it won't.
Greetings,
Marco
Logged In: NO
Hello, Marco. I am sorry for delay...
I have tested these formulas in Excel97, Excel2000,
OpenOffice and I don't have any troubles with it. Could you
try to repeat it with WriteExcel 1.01 (original perl
module), please.
BR EvgenyBF
<code>
import random
import pyXLWriter as xl
wb = xl.Writer("countif.xls")
ws = wb.add_worksheet()
for i in xrange(10):
ws.write([i, 0], random.randint(1, 100))
ws.write_formula("B1", '=COUNTIF(A1:A10,">50")')
wb.close()
</code>
Logged In: NO
Oops.. I am not right.
EvgenyBF
Logged In: NO
Perl WriteExcel module (1.01, 2.12) has some error. Let's
ask John McNamara about this problem.
I have never been using these functions with the second
parametes as reference (when it is string - it's working)..
Logged In: NO
Perl code:
<code>
#
#Strange bug - formula is not updating before edit it.
#
use strict;
use Spreadsheet::WriteExcel;
my $wb = Spreadsheet::WriteExcel->new("countif_pl.xls");
my $ws = $wb->add_worksheet();
$ws->write_formula("B1", '=COUNTIF(A1:A10, C1)');
$ws->write("C1", ">5");
for(my $i = 0; $i < 10; $i++) {
$ws->write($i, 0, $i);
}
$wb->close();
</code>
Python code:
<code>
"""
Strange bug - formula is not updating before edit it.
"""
import random
import pyXLWriter as xl
wb = xl.Writer("countif_py.xls")
ws = wb.add_worksheet()
for i in xrange(10):
ws.write([i, 0], i)
ws.write_formula("B1", '=COUNTIF(A1:A10, C1)')
ws.write("C1", ">5")
wb.close()
</code>