Spreadsheets as input to chatgpt

I would like to input a spreadsheet into the prompt and ask questions about it (eg summarize a column or entire spreadsheet, generate formula for one of the columns etc). Lets assume the spreadsheet is small enough to fit within context length limits. For a simple spreadsheet with just numbers, I can convert it to csv and pass that as input. But lets say the spreadsheet has formulas and we also want to generate formulas for the user?

  • What would be a good representation format for spreadsheets with formulas?
  • What if I want to use a much larger spreadsheet as input? Is there a way to use vector db like pine cone to accomplish the same tasks?

Thank you in advance!

Be aware that ChatGPT is not very good at math.

Correct… thats why I want it to generate formulas, not actually do the math. Also, many of the columns would be just text (eg imagine a work planning spreadsheet)

I’m not sure it’s going to do formulas very well either. It’s a language model, it doesn’t know anything about math or algebra specifically.

You may like to investigate LangChain that is an open source development to supplement and extend functionality of GPT. They have such extension as math and reading local files (CSV., etc.) add google search result, wikipedia.

3 Likes

+1 @takashisendo for the LangChain suggestion. See

https://python.langchain.com/en/latest/use_cases/tabular.html

https://python.langchain.com/en/latest/modules/agents/toolkits/examples/csv.html

TBH it seems a slippery short slope from the LLM generating the code it needs to query Pandas to I’m sorry, Dave. I’m afraid I can’t do that

1 Like

Thank you all for your input… Didnt realize Langchain had support for tabular data!

2 Likes