Skip to content

Instantly share code, notes, and snippets.

@maacl
Last active January 5, 2026 16:25
Show Gist options
  • Select an option

  • Save maacl/3224be7c2acfa7c3263653c018ce846d to your computer and use it in GitHub Desktop.

Select an option

Save maacl/3224be7c2acfa7c3263653c018ce846d to your computer and use it in GitHub Desktop.
Arrows to Ref
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