Code Monkey Monday- Hiding Excel Equations in Cells

This isn’t a particularly high-tech post, but it helped me out in tricking innocent bystanders of a cell’s true intention. Suppose you are using Excel and want to show someone a nonsensical output from a cell evaluation. You type in something innocuous, like =rand(), which should give a random number between 0 and 1. If you want the “random” number to always be between .5 and .75, however, you could type =rand()*.25+.5. In my case, I wanted to show someone the equation “=rand()” but the output from “=rand()*.25+.5”, so that whenever I updated, it would give a number between .5 and .75. The observer would be confused and hilarity would ensue as the “random” number always falls between .5 and .75. To do this, type “=rand()” at the far left of the cell equation box, like normal. Then put a bunch of spaces until you get to the middle of the equation box, and put “*”. Then put more spaces until you are off the initial screen and type the rest of the equation “.25+.5”. Now, when the equation is viewed, the observer will only see the “=rand()”, unless they are looking very closely and notice the odd multiplication sign in the middle of the line. In my experiments, I have found that Excel will delete your excessive spaces if you only put “=rand()” on the far left and “*.25+.5” off the screen. For some reason, the spaces are not deleted if you type something in the middle of the equation box. Use this information as you will.

excel hiding equations

Leave a Reply

Your email address will not be published. Required fields are marked *