dimanche 26 avril 2020

How do I create an "if and" statement to conditionally format a column of cells using xlsxwriter in Python

This isn't working (obviously), so i'm wondering if there are any suggestions. Thank you.

The goals: - If AA2 > 0 and AB2 < 0, then format cells in column A with formatc3. - If AA2 < 0 and AB2 > 0, then format cells in column A with formatc3.

worksheet.conditional_format('A2:A2100', {'type':   'formula',
                                        'criteria': '=AND($AA2>0,$AB2<0)',
                                        'format':   formatc3})

worksheet.conditional_format('A2:A2100', {'type':   'formula',
                                        'criteria': '=AND($AA2<0,$AB2>0)',
                                        'format':   formatc3})

Aucun commentaire:

Enregistrer un commentaire