openpyxl if condition formula with reference fails
<p>Using python 2.7 and openpyxl, I am inserting an IF formula into excel worksheet that references fields in other sheet.</p>

<p>While other formulas work (CONTIF, COUTN, SUM, etc) I kind of do not find the reason for this "simple" IF formula does not to work. Only IF is the problem</p>

<p>This is my code </p>

<pre><code>for i in range(0,len(sortedWorkers)):
        for a, rr in enumerate(dates):
            row_nb = i + 3
            coll = 3 + a
            clmn_letter = get_column_letter(coll + 3)
            # =IF(Worked!I$2=7;Worked!I3;"")
            valFormula = '=IF(Worked!%s$2=7;Worked!%s%s;"")' %(clmn_letter,clmn_letter, str(row_nb))
            _cl = ws12.cell(column= coll, row= row_nb, value=valFormula)
</code></pre>

<p>in the comment you can se the formula. The format is correct. It also works if I manually insert it into excel.</p>

<p>Also field coordinates and everything matches. </p>

<p>Any suggestions?
Thank you</p>

<p>So at the end the whole problem was that with using IF formula commas have to be used "," not semi-colons ";"</p>

<p>NB you must use the English name for a function and function arguments must be separated by commas and not other punctuation such as semi-colons.</p>

python excel openpyxl