Skip to content

Instantly share code, notes, and snippets.

@dserodio
Last active January 17, 2024 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dserodio/412f276ffbfbca9f31e17f2cea14b6a8 to your computer and use it in GitHub Desktop.
Save dserodio/412f276ffbfbca9f31e17f2cea14b6a8 to your computer and use it in GitHub Desktop.
Google Sheets snippets

Format values in k/M/B format (source)

Use the following custom format:

[<999950]0.0,"K";[<999950000]0.0,,"M";0.0,,,"B"

This formula calculates the difference between a given date (H11 in the example) and today, and formats it as Y years, M months, or just M months if Y=0

CONCAT(
  IF(DATEDIF(H11;today();"Y") > 0;
    DATEDIF(H11;today();"Y") & " years, ";
    ""
);DATEDIF(H11;today();"YM") & " months")
Misc. Google Sheets snippets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment