dream-num / univer

Univer is an isomorphic full-stack framework for creating and editing spreadsheets, docs, and slides across client and server.
https://univer.ai
Apache License 2.0
7.52k stars 654 forks source link

[Bug] Formula: Prevent Relative Cell References from Updating After Table Changes #4076

Closed zx-brave closed 4 days ago

zx-brave commented 2 weeks ago

Before you submit this issue, have you checked the following

Affected packages and versions

0.42

Reproduction link

https://stackblitz.com/~/github.com/awesome-univer/sheets-vite-demo

Expected behavior

Given two tables: sheet1, sheet2 Data Table as follows: Date Region Product Sales
2024-01-01 North Apples 100
2024-01-01 South Oranges 200
2024-01-02 North Apples 150
2024-01-02 South Oranges 250
2024-01-03 North Apples 200
2024-01-03 South Oranges 300

1.Cell A9 uses formula =SUMIFS(D2:D7, B2:B7, "North", C2:C7, "Apples") 2.Copy Sheet1 to Sheet2 3.Change the formula in sheet1 A9 to =SUMIFS(D2:D7, B2:B7, "North", sheet2!C2:C7, "Apples").

When Modify C2:C7 in Sheet1 to move to G2:G7.

Actual behavior

Result: The formula will change to SUMIFS(D2:D7, B2:B7, "North", sheet2!G2:G7, "Apples").

Expect: The formula in A9 should remain unchanged.

System information

No response