Pull values randomly from a column (not a row)

MSC

Board Regular
Joined
Sep 23, 2004
Messages
57
Office Version
  1. 2021
Platform
  1. MacOS
Hi, I think this is pretty simple but I can't figure it out after many minutes of Googling here and other sites, thank you in advance for your help.

I have a long list of values in one row and I've successfully created a cell out to the side that randomly picks one value, using =index(B3:B184,randbetween(1,rows(B3:B184)),1).

That works great.

What I can't do is create the same thing to pull from a column of values. I've tried using the above formula but changing the cell reference to D2:J2, and then changing "rows" to "columns" but that returns #REF! despite there being straight-up text values in cell D2, J2, and everything in between.

What would you suggest?
Thanks,
Mike
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
If you are trying to pull from a single column why are you using D:J2 which is a single row?

What version of Excel are you using?
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Today I'm on my work PC, which is Excel for Office Home/Business 2019, version 2104, build 13929.20386.

Sorry for the rows/columns confusion, my confusion stems in part from the fact that my first formula - containing the word 'rows' - works to pull data housed solely in columns (column B).

So I now want to find a way to get data housed in one row (row 2), which seems like it would requires the word 'columns' in the formula somewhere. Thank you.
 
Upvote 0
Ok, how about
Excel Formula:
=INDEX(D2:J2,RANDBETWEEN(1,COLUMNS(D2:J2)))
 
Upvote 0
Solution
Bingo, getting rid of the
,1
at the end worked - thank you for your help.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,448
Members
448,966
Latest member
DannyC96

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