0

I have implemented a calculator in a Google Sheet, and would like to embed it in my website. There will be multiple users. They should be able to enter numbers and see the result, perhaps with a chart, right there in the web page. I do not want to give them full access to the spreadsheet. How do I do this?

1

A Google Sheet can be embedded in a web site, but all changes by users are saved automatically and right away, and users see each other's changes in real time. Further, in order to enter numbers in cells, the users will need edit access to the spreadsheet. You can embed the spreadsheet so that the menu bar is not visible, but a determined user with edit access will still be able to make a copy of the original if they really want it.

See this web page for an example of what an embedded spreadsheet looks like.

To create a calculator using Google tools, the proper way is to write a web app. The web app can use a Google Sheet to do the calculations in the background, but its user interface will have to be written with HTML and JavaScript. All the code can be part of the same script project that is bound to the Google Sheet.

You may want to take a look at this example:

  • Web App - basically a form that lets you enter parameters and show the result
  • Google Sheet - all the code is here.

This demo web app sends data from the form to the spreadsheet where a doGet() function stores it in a row. The results are calculated using array formulas, and returned to the form for display to the user.

For more information, see:

To try it out yourself, open the Google Sheet and choose File > Make a copy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.