Skip to content

Cory Foy

Organizational agility through intersecting business and technology

Menu
  • FASTER Fridays
  • Mapping Mondays
  • Player Embed
  • Search Videos
  • User Dashboard
  • User Videos
  • Video Category
  • Video Form
  • Video Tag
Menu

Adding up a list of numbers using Calculator

Posted on November 11, 2005 by Cory Foy

Interesting little trick I came across today. I had a list of values that looked like:

Compare time: 0.109375s
Compare time: 0.015625s
Compare time: 0.03125s
Compare time: 0.015625s
Compare time: 0.03125s
Compare time: 0.015625s

I wanted to add up all the values, and didn’t have access to a Linux box (where I could just run awk in a while loop), nor do I have Python installed on here.

So, I opened up the list in notepad, replaced all the “Compare time: ” with an empty string. Then, something told me to try replacing the trailing “s” with a plus sign, and pasting it into the windows Calculator window. I tried it with just the first two:

0.109375+
0.015625

and sure enough, it worked. So I copied the entire list, and pasted it into the Calculator window, and viola! I had my answer. For once, a nice surprise in a GUI!

2 thoughts on “Adding up a list of numbers using Calculator”

  1. Ian says:
    November 14, 2005 at 7:11 am

    And just to balance out the light and dark sides, the same experiment in PowerToy Calculator gives…
    0.109375+
    ERROR:Unknown characters occurred []

  2. Harry says:
    January 9, 2012 at 4:00 pm

    If you append an equal sign to the last number in the list it will show the total and you avoid one mouse click :)

    -HD

Comments are closed.

© 2025 Cory Foy | Powered by Superbs Personal Blog theme