Ask Your Question

Duplicate Sheet changes Sheet References

asked 2019-02-05 11:52:35 +0200

elfabyanos gravatar image

updated 2019-02-05 11:59:44 +0200


I'm trying to copy a sheet that has formulae that references other sheets. When I duplicate the sheet all the cell references that refer to other sheets change and this appears to be dependant on where in the sheet list the sheet appears. For example, if a cell in Sheet 2 references Sheet 1, if I duplicate Sheet 2 and place the duplicate after Sheet 2 then all the cell references in Sheet 3 that should be pointing to Sheet 1 point to Sheet 2.

Is there a way to prevent this from happening? As the structure of the sheets is in 99% of spreadsheets completely arbitrary I find this a bizarre limitation on methods of working, and certainly Excel does not function in such a way. I should imagine that the vast majority of users who duplicate a sheet do so in order to test some variations or create a new profile or year or some other identical calculation, so want the sheet references to remain the same. I can't think of a single application where duplicating a sheet would require a relative shift in sheet references (would be interested to know!)

Just to be clear I am not referring to absolute/relative cell references, I am referring to the sheet references that preceed the cell references.

Many thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-02-05 12:07:46 +0200

updated 2019-02-05 12:13:52 +0200

This is exactly absolute/relative cell references what you are talking about. Placing $ sign before sheet name gives you an absolute reference to the sheet, while using sheet name without $ sign gives you a relative reference, the same as with cells.

Placing =$Sheet1.A1 and =Sheet1.A1in cells on the Sheet2 and then duplicating Sheet2 to Sheet3 placing Sheet3 after Sheet2 will evaluate furmulas in Sheet3 to =$Sheet1.A1 and =Sheet2.A1 respectivly. By the way, Excel implements the same behaviour.

edit flag offensive delete link more


Excel does not implement this same behaviour - placing a $ in front of the sheet reference breaks the formula in Excel. When building a slightly different report it is common to create a duplicate of an existing report and then start adapting it - this is quick and easy in Excel and I have been working like that for years.

So in order to have an excel spreadsheet compatible with calc, one would need to go through and change all the sheet references to place a $ in front of each one? And how would this be done in one fell swoop? I can see how to do it quickly for each sheet referenced, but if there are many different sheets referenced it would be easy to do a find and replace on 20 sheets referenced and miss the 21st. Surely this is not the only option? Does saving keeping the file as ...(plus)

elfabyanos gravatar imageelfabyanos ( 2019-02-05 12:25:57 +0200 )edit

By default, LibreOffice prepends sheet names with $ on creation, or on import. This allows to have the compatibility with other formats/applications that lack support relative sheet referencing.

How did you created the references in your sheets? Did some built-in operation in LO made all those without the $ without you explicitly chose the format? If so, possibly that's a bug - please file it to bug tracker and explain how to reproduce.

If you created them manually, though, not knowing that LibreOffice supports more features than your familiar application, that is not a program error. You may use e.g. F4 to change the types of references ... or use Find & Replace.

Mike Kaganski gravatar imageMike Kaganski ( 2019-02-05 12:52:33 +0200 )edit

OK great thanks! So this is solved. Yes I had developed the spreadsheet from scratch in LO unaware of that LO "supports more features".

Solution -

  • Save as an xlsx
  • Re-open it
  • Copy the required sheet
  • Find and replace all $' with '
  • Save back to an ods

If anyone has ever used relative sheet referencing to good effect I would love to hear of it. Seems like a solution that benefits almost nobody and hinders everyone else.

elfabyanos gravatar imageelfabyanos ( 2019-02-05 13:13:22 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-02-05 11:52:35 +0200

Seen: 262 times

Last updated: Feb 05 '19