In Excel, a shared formula is defined over a range of cells. If one of those cells' formulas is overwritten with some other formula, the original shared formula range remains intact but that cell has an actual formula instead of a shared formula ID.
I've attached a workbook that I created in Excel.
If you inspect the OpenXml you will see that a shared formula was defined over C4:C6.
I then explicitly set a formula in C5.
If you open the attached workbook in EP Plus and overwrite the formula in C4, you will see that the formula in C5 is converted back into the shared formula that it "inherited" from C4.
This occurs due to the shared formula splitting that occurs when updating shared formulas. There is a built-in assumption that any cell in the shared formula range really does contain that shared formula. This is a safe assumption for any shared ranges created in EP Plus due to the splitting algorithm, but it does not account for the Excel representation of the case.
Comments: This is being addressed in fork: https://hg.codeplex.com/forks/zpffpz/sharedformulasplitting
I've attached a workbook that I created in Excel.
If you inspect the OpenXml you will see that a shared formula was defined over C4:C6.
I then explicitly set a formula in C5.
If you open the attached workbook in EP Plus and overwrite the formula in C4, you will see that the formula in C5 is converted back into the shared formula that it "inherited" from C4.
This occurs due to the shared formula splitting that occurs when updating shared formulas. There is a built-in assumption that any cell in the shared formula range really does contain that shared formula. This is a safe assumption for any shared ranges created in EP Plus due to the splitting algorithm, but it does not account for the Excel representation of the case.
Comments: This is being addressed in fork: https://hg.codeplex.com/forks/zpffpz/sharedformulasplitting