Search TeachExcel.com
TeachExcel.com
TE
Teach Excel MS Office Tutorials Excel Consulting Services Excel Forum
Excel Video Tutorials Excel Tips Free Excel Macros Excel Help Resources Contact TeachExcel
Video Tutorials
  • Free Macros
  • Excel Help Directory
  • Excel 2007 Resources
  • Keyboard Shortcuts
  • Excel Forum
  • Contact/About

Tutorials: Formulas



Featured Tutorial
Dynamically Update Drop-Dowm Menus in Excel
Featured Macro
Delete Empty Rows in Excel

Generate Random Numbers with Decimals in Microsoft Excel

Video | Similar Helpful Excel Resources

Bookmark and Share

This tutorial shows you how to generate random numbers which have decimals in excel. This means the numbers will not just be integers; they will be decimals or fractions between two limits which you set. This is similar to the RANDBETWEEN() function except that that function only returns integers. Here, the RAND() function is used to create the decimal numbers in excel.

This is a very useful trick when running simulations in excel.
   Topics Covered
Generate Random Numbers which are Fractions and Decimals in Excel
Generate Numbers with Decimals Between two limits - an upper and a lower limit
RAND() Function
   Difficulty:         Intermediate
   Video:               Yes



Got a Question? Ask it Here in the Forum.



Similar Helpful Excel Resources

Using Excel Generate Random Numbers 1 To 52 Without Repeating - Excel

View Content
I want to shuffle a pack of playing cards using excel


Generate Random Sequence Of Numbers In Excel - Excel

View Content
Hi everyone !

Can someody help me generate a sequence of numbers like
0
1
2 2
3 3 3
4 4 4 4
till 200

in excel with the help of a macro ??
My code is like this :

Code:

Sub Generate_Numbers()

 Dim CountRow As Long
 Dim cLastRow As Long
 Dim i As Double

 For CountRow = 1 To 201
 Worksheets("random numbers").Cells(CountRow, 1).Value = i
 i = i + 1
 Next CountRow

End Sub


Thank you !

Generate Random Numbers In Random Cells - Excel

View Content
Hello All,

I am working on a Random Cycle Count Generator that provides random SKU#s based on 3 separate columns of SKU listings. The user clicks a button to generate the SKU#s to cycle count for that day.

What I would like to see is a date stamp in the columns next(B,D,F) to the referenced SKU listing(A,C,E) based on which SKU#s are generated. This will let me see the last date that the SKU was generated. I would also like it to automatically save after generating.

I appreciate any help that you can provide. I looked on the forums for a while and couldn't find any obvious solution.

Thanks,
Thomas

Macro Code To Generate 3 Random Lines Of 6 Numbers From 18 Pre Selected Numbers - Excel

View Content
Hi,

I run a lottery syndicate with nine people in who have all chosen two numbers each.

What I would like to have is a macro that randomly generates three lines of 6 numbers based on our 18 pre selected numbers i.e. use all 18 numbers with no number duplicated in any of the three lines generated (6 numbers per line).

Example numbers 2, 5, 7, 10. 11, 15, 17, 19, 20, 23, 24, 27, 29, 31, 32, 41, 44, 49,

Any assistance would be greatly appreciated

Many thanks in advance


Rob

N.B. Excel version 2003

Generate Random Numbers - Excel

View Content
I want to be able to generate random numbers as weights for the amount of companies selected,eg if 5 companies where selected then generate 5 weights.
How do you think I can go about it ,as I have thought of creating different types of sheets and just have a command button for different scenario and just trusting the user to select the appropriate one.?

Generate Random Odd Numbers - Excel

View Content
Hello,

Can an expert in this forum devise of a VBA macro that creates 500 random numbers in cells A1:A500?

The numbers must all be odd and contain 3 digits in each cell... i.e.

135
179
977
etc...

many thanks!
andy

Generate Random Numbers - Excel

View Content
Hey, I was wondering if there was a way to generate random numbers in a series of cells without repeating one another.

For example, Say I want A1-D1 to be populated randomly with 1-6, not repeating a number at all. So i'd have a sequence like 132654 or 452136.

Is that possible to do?

Using Vba To Generate Random Numbers - Excel

View Content
Dear Forum,

I am using the VBA code below (bottom) to return random numbers for a selected area of cells where the range of random numbers is between 1 and the
total number of cells. Unfortunately sometimes the random numbers appear more than once and I would like to amend this to ensure duplicates are not included, any help would be greatly appreciated, thanks, Matt

Ps I have already tried substituting with VBUniqRandInt() but it returns #NAME? in every selected cell??, i.e;

Code:

Sub RandomTable4()

For Each r In Selection
    r.Formula = "=int(VBUniqRandInt() *" & Selection.Count & "+1)"
Next
End Sub

Sub RandomTable4() ' but this returns duplicates

For Each r In Selection
    r.Formula = "=int(Rand() *" & Selection.Count & "+1)"
Next
End Sub




Generate Random Numbers Between 0-9 - Excel

View Content
I am trying to generate random numbers between 0 - 9 in ten cells that do not repeat an always include every value 0 - 9 (0, 1, 2, 3, 4,...9). The object is to have the numbers randomize each time. So cells A1:A10 could look like this:

3
9
4
5
1
0
6
8
7
2

Or, they could look like this:

9
7
5
2
8
4
1
3
6
0

I understand the rand and randbetween formulas, but am having trouble finding the logic to make them non-repeating, all inclusive and still random.

Any help? A bonus point for anyone who can figure out what this is for (hint: there is a kick-off in about four hours).

Random Numbers To Generate Amount Between Two Numbers - Excel

View Content
Hello,
I have to build an excel sheet to do an invoice.
I know the total amount and the quantities for the items in the invoice.
I have to generate random prices for them , but the total amount should be between 7000-7800, and if the quantity is bigger for an item, the price should be smaller.
Any ideeas?
Thanks.

Contact | Privacy Policy | Disclaimer
Copyright© 2012 TeachExcel.com