Random Numbers in Excel

To get a random number in Excel, use the RAND() function, which returns a random number between 0 and 1.  It will return a different random number each time the cell is recalculated, such as when you reopen the workbook (e.g. press F9 to refresh and you'll see the value change).

Random Numbers In a Specified Range

To get a random integer (i.e. whole number) in a particular interval, use the RANDBETWEEN() function, which has two inputs noting the lowest and highest values you want random numbers between.  E.g. =RANDBETWEEN(200,300) will return a random integer between 200 and 300.  Again you'll get a new random number each time you refresh (you can Copy and Paste Values if you want to keep the random numbers you've generated).

If you need a random number in an interval which isn't rounded to the nearest whole number, you can use the RAND() function output to do get this.  For example, =200 + RAND() * (300-200) will give you a random number between 200 and 300 which isn't rounded.

The output from each of these functions is shown in the below output:


Get today's date in Excel

Working with dates can be a key thing in Excel.  This tutorial gives you a few different ways to get the current date in Excel 2003, Excel 2007 and Excel 2010.

The NOW() function

One way to get the date is using the function =NOW() which just puts the current date and time in to the cell as follows:

You can then format the cell (right click -> Format Cell, or Press Ctrl+1) to display it as you like, for example as a date in the format dd/mm/yyyy. Continue reading

Exporting from Movable Type to WordPress

Slightly off topic post for this blog, but I'd like to share my experiences of moving a blog from Movable Type 4 to WordPress 3.4 blogging software.

The reason I chose to switch was that, while MovableType produces static web pages which are quick to load on a slow webserver, the interface felt too cluttered - almost like it is trying to do too many things.  To top it off, it was suggesting that I link to certain "promoted" sites which is an immediate turn off.

I've exported from MovableType in the past, and encountered a few issues, but this time seemed to go much smoother.  Perhaps it is partly due to having a smaller blog, or perhaps the process has improved.  This article has a guide showing the steps I followed to move all my posts across to a fresh install of WordPress.

Continue reading

Shortcut key to paste values in Excel

If you came here looking for an easy short-cut key to paste values in Excel then it's bad news I'm afraid - there just isn't a simple keyboard shortcut in the same way there is to cut, copy or paste normally. However there is a way to paste values using the keyboard, which this tip shares with you.

Alt Keys

Alt KeysIf you press Alt in Excel, you may have noticed that Excel puts letters on the ribbon, indicating the Alt key associated with that tab or function. If you press Alt, then press the letter for the tab you want (e.g. H is the home tab), you can then choose the function you want from that tab (e.g. C for copy, V for paste), and so on.  Some items, including paste, have further sub-items which you can select by stringing these letters together.

So to get to paste values this way, you can do the following0: Alt - H - V - V.  Just press each one in time, no need to keep any key pressed.

How to format a 500GB or 1TB drive as FAT32 to connect to an Xbox or PS3

If you want to connect a portable USB hard drive to an Xbox 360 or PS3, you'll need to format it as FAT32. Unfortunately, Microsoft no longer offers this as option in Windows for formatting drives larger than 32GB. There are third party tools available to do the job though, and the following instructions explain how to use them. Follow with care though, or you could lose important information on your computer. (Also please be aware that formatting a drive will delete everything on it.)

Continue reading

How to unzip a file on a server via SSH

It can save a lot of time to upload a single file to your web server then extract it, rather than extracting to your own computer and uploading the contents.

Assuming you've managed to upload the file to your server (e.g. using FTP), and connect via SSH to a unix server (PuTTY is a good client), follow these steps to extract it.

  1. Navigate to the directory containing your file.  Use the command cd (change directory), for example: cd MyDirectory. You can use ls to view the files in each folder.
  2. Use the unzip command to extract: unzip MyZipFile.zip. Type unzip by itself to find out more about it, including various options for using it.
  3. If you want to move the files you've just extracted, you can use the mv command. If the files have been extracted to a subfolder and you want them out, try mv MyZipFile/* . (the dot indicates the current folder).
  4. Finally, you can delete the zip file if you don't need it anymore by rm MyZipFile.zip.