Wednesday, June 16, 2010

converting K, M and G to numbers in excel

i'm not sure if the command 'du' in linux to see Disk Usage has an option to show it in Bytes.

I normally use 'du -h' which shows it in "human readable format", but that show it with K for Kilobytes, "M"egabytes and "G"igabytes...

I needed to compare sizes of directories in Excel... so I did this formula for converting the letter to their equivalente numeric. it's in spanish, because my excel is in spanish, and excel has that annoying feature which translates function names !

=SI(ESNUMERO(ENCONTRAR("K";A4692));SUSTITUIR(A4692;"K";"")*1000;SI(ESNUMERO(ENCONTRAR("M";A4692));SUSTITUIR(A4692;"M";"")*1000000;SI(ESNUMERO(ENCONTRAR("G";A4692));SUSTITUIR(A4692;"G";"")*1000000000;"")))

No comments:

Post a Comment

cancel script completely on ctrl-c

I found this question interesting: basically how to cancel completely a script and all child processes : You do this by creating a subro...