[GH-ISSUE #334] Assign the result of a formula to a variable #270

Closed
opened 2026-05-05 12:03:48 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @sapomuyverde on GitHub (May 20, 2021).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/334

Originally assigned to: @jmcnamara on GitHub.

It is possible to assign the result of a formula to a variable and then use that variable, for example: I do something like this:

worksheet_write_formula(worksheet, lin, 8, "=SUM(I5:I10), numberRightTotal) --> (total sales, to say)
Then make use of the "variable", without repeating the formula, something like this:
worksheet_write_number(worksheet, lin+10, 8, total sales, numberRight )

Any idea how to solve in this way.

Regards,
Javier

Originally created by @sapomuyverde on GitHub (May 20, 2021). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/334 Originally assigned to: @jmcnamara on GitHub. It is possible to assign the result of a formula to a variable and then use that variable, for example: I do something like this: worksheet_write_formula(worksheet, lin, 8, "=SUM(I5:I10), numberRightTotal) --> (total sales, to say) Then make use of the "variable", without repeating the formula, something like this: worksheet_write_number(worksheet, lin+10, 8, total sales, numberRight ) Any idea how to solve in this way. Regards, Javier
Author
Owner

@jmcnamara commented on GitHub (May 20, 2021):

Unfortunately that isn't possible. Libxlsxwriter doesn't evaluate the formula in any way so there isn't any results to return/store.

<!-- gh-comment-id:845549298 --> @jmcnamara commented on GitHub (May 20, 2021): Unfortunately that isn't possible. Libxlsxwriter doesn't evaluate the formula in any way so there isn't any results to return/store.
Author
Owner

@sapomuyverde commented on GitHub (May 21, 2021):

Thank you for your answer and for your time.

<!-- gh-comment-id:845986923 --> @sapomuyverde commented on GitHub (May 21, 2021): Thank you for your answer and for your time.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#270
No description provided.