Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Byte formatting for Google Sheets
@CommanderTso

This comment has been minimized.

Copy link

@CommanderTso CommanderTso commented Feb 28, 2019

Brilliant - thanks!

@dzgnnl

This comment has been minimized.

Copy link

@dzgnnl dzgnnl commented Mar 26, 2019

Awesome thanks!

@mherrmann

This comment has been minimized.

Copy link

@mherrmann mherrmann commented Jan 8, 2020

Very cool!

@pferrel

This comment has been minimized.

Copy link

@pferrel pferrel commented Jan 16, 2020

Much appreciated!

@FeherMarcell

This comment has been minimized.

Copy link

@FeherMarcell FeherMarcell commented Apr 3, 2020

This is awesome, thanks!

@cosjef

This comment has been minimized.

Copy link

@cosjef cosjef commented Aug 3, 2020

How would I adjust this to also accomodate for Terabyte values?

@minkovich

This comment has been minimized.

Copy link

@minkovich minkovich commented Oct 30, 2020

[<1000000000000]##0.00,,," GB";[<1000000000000000]##0.00,,,," TB";#,##0.00,,,,," PB"

@connollyst

This comment has been minimized.

Copy link

@connollyst connollyst commented Nov 19, 2020

Exactly what I was looking for @minkovich, good looking out!

@Daniel15

This comment has been minimized.

Copy link

@Daniel15 Daniel15 commented Dec 8, 2020

This uses decimal bytes (1000 bytes = 1 KB), not binary bytes (1024 bytes = 1 KB). Is there something similar for binary bytes?

@varenc

This comment has been minimized.

Copy link

@varenc varenc commented Dec 9, 2020

@Daniel15, I don't believe that's possible with just a custom number format. You can only cut digits off and not calculate new values. There's certainly more manual ways to format bytes correctly though. (but this is extra-nice because the formatted cells value is still treated like a number)

@Daniel15

This comment has been minimized.

Copy link

@Daniel15 Daniel15 commented Dec 9, 2020

@varenc Yeah, that's what I thought. It's really frustrating that Sheets doesn't have it as a built in number format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment