A ‘Rand’om Word Trick For You


Here’s a Word trick you can use to entertain and amuse your family and friends.  OK, I’m overstating a bit;
unless your family and friends are exceeding geeky, they’re not going to be
impressed.  But if you haven’t seen it before, it might just surprise you.

Open Word.  It doesn’t have to be the most recent version; I think this works all the way back to Word 97.  Got it open?

Now make a new blank document and type: =rand() and press Enter.  You should see a few paragraphs of filler text appear in your document.  In the US version of Word 2003, the text is “The quick brown fox jumps over the lazy dog.”  This is an example of a “pangram“–a sentence or phrase that contains all the letters of the alphabet.  The preferred version actually ends “over a lazy dog” because it’s shorter and therefore more impressive.

The shortest pangram I’m aware of in English that doesn’t use a proper name is “Sphinx of black quartz, judge my vow.” (29 letters.)  A few perfect, 26-letter pangrams exist, but they use dubious acronyms and proper names, such as “Glum Schwartzkopf vex’d by NJ IQ.”

Different languages of Word use different text for rand().  I seem to recall one of the European languages includes a fairy tale, and a few versions use the historic but meaningless “lorem ipsum” text.

Word 12 responds to rand() with a long treatise on the AutoFormat feature from versions past.  I’m not sure why that change was made–probably because the new text is much longer and therefore more varied than repeating “quick brown fox” over and over again.

But wait, there’s more.  You can use the advanced rand() syntax to control the length of the text.  Try: =rand(10,8) [enter].

Word inserts 10 paragraphs of 8 sentences each.  You can set the two numbers inside the parentheses to whatever values you like (up to 200.)

So why does this feature exist?  We use it extensively internally for testing purposes–it allows us to fill up a lot of pages quickly to try out various features to see how they’re working.  Outside of Microsoft, teachers who train other people to use Word find it useful for the same reason, so we’ve left it in the product.

Believe it or not, this whole feature is documented in a Microsoft Knowledge Base article.

Comments (8)

  1. BradC says:

    I don’t train daily anymore, but as an instructor, this is an extremely handy feature.

    Question about headers and footers across section breaks in a 10 page document? =rand(50,20) gives you about 13 pages of text.

    I like the idea that in v12 it is a longer chunk of text. The "quick brown fox" version tends to be very patterened, and with many font sizes (Times 11 pt), you get exactly 2 sentences on each line, and they don’t even look like paragraphs anymore.

    Still a very handy trick. Any other easter eggs? (flight sims, pinball games) Or are those verbotten anymore?

  2. I learned about the rand() command years ago, and STILL use it quicky fill Word with text for demonstrations. (But I had NO idea about the parameters AND that there’s a KB212251 for it!)

    The shortest sentence that I know with all the letters (which still makes sense to me) is:

    PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS

  3. Step says:

    Yep, just saw this on the Channel 9 video – cool. Don’t know if I’ll get a chance to use it, but I can impress my geeky friends, as you pointed out. 🙂

  4. Mike says:

    Wouldn’t it be more useful (and perhaps even more intuitive) if a function called "rand" actually returned random text, or something close to it (see lipsum.com)? It’s interesting that the developers chose that name, since the text returned is many things (deliberate? repetitious, perhaps?) but it is most certainly *not* random.

    Anyway for filling lots of pages, isn’t it more useful to have realistic-looking and feeling sentences and paragraphs, rather than sentences that use every letter of the alphabet? I could see the latter being useful for picking a typeface or similar. Is there an equivalent that you know of for generating Lorem-ipsum-like copy?

  5. jensenh says:

    I don’t know of a built-in way to get anything other than the default text, but it would be a pretty easy macro to write.

  6. dhchait says:

    Fans of Cecil Adams, of The Straight Dope fame, will of course recall the classic perfect pangrams, with no acronyms:

    <blockquote>

    Cwm, fjord-bank glyphs vext quiz

    … which means, "Carved figures in a mountain hollow and on the bank of a fjord irritated an eccentric person." ("Vext," of course, is an alternate form of "vexed," and "quiz" means "an eccentric person.") Similarly we have:

    Junky qoph-flags vext crwd zimb

    … meaning, "Trashy flags with a design resembling the Hebrew letter qoph exasperated an Ethiopian fly whose customary habitat was an ancient Celtic stringed instrument (crwd)." But it’s not like I’m telling you something you don’t already know.

    </blockquote>

    from <a href="http://www.straightdope.com/classics/a2_246.html">here</a&gt;. Hope this has been enlightening 🙂

  7. jensenh says:

    Daniel wins the award for most obscure references in a blog comment 2005. 🙂

  8. MSDNArchive says:

    On lorem ipsum – yes, it’s filler text, but I don’t think I’d call Cicero meaningless. It’s truncated, but not meaningless.

    Ipsum lorem is also a language spoken (written?) in bookworld in Jasper Fforde’s Thursday Next series.

Skip to main content