Wednesday, February 10, 2010

Random Number

RAND()
- return real number that >=0 and < 1
RANDBETWEEN(bottom,top)
- return integer in specified range

Note: every Excel calculations, random number will change, to fix the value generated
-> enter =rand() in formula bar and press F9

For example
  1. =rand() => ex. 0.135
  2. =rand()*10 => return real number that >=0 and < 10
  3. =int(rand()*10) => return integer that >=0 and < 10
  4. =randbetween(1,10) => return integer that >=1 and <=10 (ex. 7)

Random in VBA
RND()
- return single value that >=0 and < 1

Int(Rnd * (bottom- top+ 1)+ bottom)
- return integer in specific range

For example
--------------
Sub test()
Randomize
MsgBox Rnd()
End Sub
=> return single number ex. 0.741725
--------------
Sub test2()
'to find random integer in range between 1 and 10
Dim RandNo As Integer
Randomize
RandNo = Int(Rnd() * 10 + 1) '10 = 10-1+1
MsgBox RandNo
End Sub
=> return integer that >=1 and <=10 ex. 6
--------------

Note: single value is ranging in value from -3.402823E38 to -1.401298E-45 for negative values and from 1.401298E-45 to 3.402823E38 for positive values

Tuesday, February 9, 2010

Excel 2007

Summary:-
- Columns : 2003 => 256 (IV) ; 2007 => 16,384 (XFD)
- Rows : 2003 => 65,536 ; 2007 => 1,048,576
- Extension : 2003 => .xls ; 2007 => .xlsx (.xlsm - macro added, xlsb - binary, xltx - template, xltm - macro added template)
- File size : smaller than 2003
- Calculation speed : faster than 2003 (multithread)
- Color available : 16M
- Automatic completion of functions
- Ribbon
- Easy to use pivot table
- OLAP & cube