Skip to content
This repository was archived by the owner on Mar 9, 2020. It is now read-only.
This repository was archived by the owner on Mar 9, 2020. It is now read-only.

Bug: formula loses reference to other worksheet when translating from A1-style to R1C1-style #479

Open
@roelvandersteen

Description

@roelvandersteen

If an ExcelAddress token satisfies the following conditions:

  • contains a worksheet name (followed by "!")
  • contains a reference to a single row or column (so it will also have a ":")

then the worksheet name is not returned when the address is translated from A1-style to R1C1-style, or the other way around.

Tests to reproduce:

const string formula = "SUM(Sheet1!A:A)";
var formulaR1C1 = ExcelCellBase.TranslateToR1C1(formula, 1,2);
Assert.AreEqual("SUM(Sheet1!C[-1])",formulaR1C1); // fails: formulaR1C1 == "Sum(C[-1])"

const string formulaR1C1 = "SUM(Sheet1!C[-1])";
var formula = ExcelCellBase.TranslateFromR1C1(formulaR1C1, 1,2);
Assert.AreEqual("SUM(Sheet1!A:A)", formula); // also fails: formula == "Sum(A:A)"

I will prepare a PR to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions