Last active
January 5, 2026 16:25
-
-
Save maacl/3224be7c2acfa7c3263653c018ce846d to your computer and use it in GitHub Desktop.
Arrows to Ref
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CLAMPED_OFFSET = LAMBDA(ref, rows, cols, IF( | |
| OR( | |
| COLUMN(ref) + cols <= 0, | |
| COLUMN(ref) + cols >= 16384, | |
| ROW(ref) + rows <= 0, | |
| ROW(ref) + rows >= 1048576 | |
| ), | |
| ref, | |
| OFFSET(ref, rows, cols) | |
| )); | |
| ArrowToRef = LAMBDA(arrow, ref, | |
| IF( | |
| ISBLANK(arrow), | |
| ref, | |
| SWITCH( | |
| UNICODE(arrow), | |
| UNICODE("⬆️"), CLAMPED_OFFSET(ref, -1, 0), | |
| UNICODE("↗️"), CLAMPED_OFFSET(ref, -1, 1), | |
| UNICODE("➡️"), CLAMPED_OFFSET(ref, 0, 1), | |
| UNICODE("↘️"), CLAMPED_OFFSET(ref, 1, 1), | |
| UNICODE("⬇️"), CLAMPED_OFFSET(ref, 1, 0), | |
| UNICODE("↙️"), CLAMPED_OFFSET(ref, 1, -1), | |
| UNICODE("⬅️"), CLAMPED_OFFSET(ref, 0, -1), | |
| UNICODE("↖️"), CLAMPED_OFFSET(ref, -1, -1), | |
| ref | |
| ) | |
| ) | |
| ); | |
| ArrowsToRef = LAMBDA(arrows, ref, IF(LEN(arrows) = 0, ref, ArrowsToRef(ArrowToRef(ref, LEFT(arrows)), REPLACE(arrows, 1, 1, "")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment