I'm using gspread and the Google Sheets API to update cell values, setting cell.value
equal to a string of a specific formula.
Example code:
# Calculates sum of cells in current row from column B to H
G_SHEETS_ROW_SUM_COMMAND = '''=SUM(INDIRECT(CONCATENATE("B",ROW(),":H",ROW())))'''
for cell in cell_list:
cell.value = G_SHEETS_ROW_SUM_COMMAND
When my spreadsheet is populated, however, my command becomes prefixed with an apostrophe ('
). This is presumably to keep the cell from being interpreted as a formula, but that's exactly what I'd like it to do.
Here's an example from my spreadsheet:
Is there a way to remove this apostrophe automatically?
I've looked into value rendering options and input_value, though these options seem to be unavailable for writing to sheets.