Need help with random number generator

daniel_dani95

New Member
Joined
Jan 30, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm working on some sort of quiz and I want to generate some amount of random numbers (specifically 80) which will represent question that is in cell with that number and then excel will over VLOOKUP find and display that question. I have question bank of 2500 questions. I found through this site that I can use RANDBETWEEN function to generate random numbers and then this,
Excel Formula:
=1+RANK.EQ(B2,$B$2:$B$81)+COUNTIF($B$2:B2,B2)-1
, in another column to make numbers unique.

My problem is that when generating unique numbers, RANDBETWEEN function gives numbers in range from 1-2500 but the other function give only numbers up to 80, never above, let alone 2500.

What did I do wrong?

Thanks for help in advance
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about
Excel Formula:
=TAKE(SORTBY(SEQUENCE(2500),RANDARRAY(2500)),80)
This will return 80 distinct numbers from 1 to 2500
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,984
Members
449,092
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top