Skip to content

Instantly share code, notes, and snippets.

View harpaj's full-sized avatar

Johannes Huber harpaj

  • TrustYou
  • Munich
View GitHub Profile
@seb26
seb26 / A_one_line_formula.md
Last active January 3, 2024 19:50
This formula can be used in Google Sheets to take a value in bytes and then represent it in a human-readable format with binary units (KiB, MiB, GiB, and so on).
=ROUND( A2/(1024)^(FLOOR(log(A2)/log(1024))), 2) & " " & SWITCH( FLOOR( log(A2) / log(1024) ) ,0,"Bytes",1,"KiB",2,"MiB",3,"GiB",4,"TiB")