New: ready-to-use spreadsheet templatesExplore the collection  →
Google Sheets · Verified tutorial

Embed a Google Sheet in Google Sheets

Create embed code in B2. Enter exactly ="<iframe src="""&REGEXREPLACE(A2,"/edit.*$","/preview")&"""></iframe>". Do not change the source URL.

Verified by JosephineAbout 60 seconds
Quick answer

Create embed code in B2. Enter exactly ="<iframe src="""&REGEXREPLACE(A2,"/edit.*$","/preview")&"""></iframe>". Do not change the source URL.

Step-by-step

1

Select the targetCreate embed code in B2.

2

Apply the changeEnter exactly ="<iframe src="""&REGEXREPLACE(A2,"/edit.*$","/preview")&"""></iframe>".

Shortcut or faster method

Select the target cell, type or paste the formula in the formula bar, then press Enter.

Expected result

B2 contains an iframe whose source uses the spreadsheet preview URL.

Common mistake

Changing the source values while applying the formatting or structure change.

Troubleshooting

Re-select B2 and repeat the final action. B2 contains an iframe whose source uses the spreadsheet preview URL.

Example spreadsheet data

This is the clean fixture used for the verified run.

Published sheet URLEmbed code
https://docs.google.com/spreadsheets/d/1SheetStepsExample/edit#gid=0

Video transcript

  1. Open the prepared Practice spreadsheet.
  2. Select the target. Create embed code in B2.
  3. Apply the change. Enter exactly ="<iframe src="""&REGEXREPLACE(A2,"/edit.*$","/preview")&"""></iframe>".
  4. B2 contains an iframe whose source uses the spreadsheet preview URL.