Skip to content

Commit 48a8f87

Browse files
committed
New tip
1 parent c1c3759 commit 48a8f87

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

content/blog/librecalctips.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,28 @@ Strings separated by `&` are concatenated together.
8282

8383
```excel
8484
"Hello " & "World."
85-
```
85+
```
86+
87+
**Mirror a cell from a different sheet**[^1]
88+
89+
Suppose there's a value in a different sheet at the same position that we want. For example, a common header bar, a summary table, etc.
90+
91+
```excel
92+
=LET(val, INDIRECT("Sheet1." & ADDRESS(ROW(),COLUMN())), IF(val="", "", val))
93+
```
94+
95+
Place this in `A1` and we'll get the value from `Sheet1:A1`.
96+
97+
The `ADDRESS` command takes two required parameters: the row value and column value. From this, it produces a string representing the cell location.
98+
99+
The `INDIRECT` command creates a *reference* based on the cell location represented as a string.
100+
101+
The `LET` command takes three parameters:
102+
103+
- The variable name
104+
- The value that the variable name evaluates to
105+
- The expression which uses the variable name
106+
107+
The `IF` command is used so that if the referenced cell is empty then it does not show a zero.
108+
109+
[^1]: Thanks to hwn for this suggestion!

0 commit comments

Comments
 (0)