closing parenthesis added to end of formula

Issue #1246 resolved created an issue

When I try to use a formula as the value of the cell, there is a closing parenthesis appended to the end in the saved spreadsheet. This results in a #NAME? error.

Namely, I use this as the value

"=VLOOKUP(A{}, $'lookup_table'.A1:B3, 2, 0) - B{}".format(i + 1, i + 1)

and the resulting value is something like

=VLOOKUP(A1, $'lookup_table'.A1:B3, 2, 0) - B1)

Any guidance on how to make this format correctly?

Comments (2)

  1. reporter

    Update on this: It had nothing to do with openpyxl. I learned about opening the output file as a .zip, and could then view the generated xml files. Turns out, they were exactly as expected. It was LibreOffice Calc that created the extra parenthesis.

    When referencing another sheet, Microsoft Excel uses sheet1!A1, while LibreOffice Calc uses sheet1.A1. I guess since the file is being saved as .xlsx it makes sense to use the Excel format.

    I was able to have the file open successfully in both Excel and Calc after updating the line to "=VLOOKUP(A{}, lookup_table!A1:B3, 2, 0) - B{}".format(i + 1, i + 1)

  2. Log in to comment