RANDBETWEEN Returns a random integer number between the numbers you specify. Remember like RAND, a new random integer is returned every time the worksheet is calculated.
I used this formula a lot when I used to audit. My audit team would need to test random samples of a population. So say I needed to test 30 invoices from an entire population of 10,000 invoices, and the invoice number sequence started at invoice number 13,978 and went through 23,978 (the total population of 10,000 invoices) I could set up a formula in excel . See example below of a typical worksheet you could to select random invoice numbers (I’ll show you the first 10 out of the 30 I needed). Obviously you’d need to head up the worksheet and add whatever other data that was required accordingly to you firm/company’s policies.