Changing Column Letters in a Formula

rwmill9716

Active Member
Joined
May 20, 2006
Messages
495
Office Version
  1. 2013
Platform
  1. Windows
=INDEX($F$7:$F$264,RANDBETWEEN(1,ROWS($F$7:$F$264)),1)

I use the above formula to randomly sample a data set in Column F. I have data that I would like to sample in other columns. If I were to put one of their letters in Cell A1, could the above formula be modified where the letter in A1 replaces the 'Fs' in the formula?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You can try the cell range address in cell A1 and use INDIRECT to call it.

Book2
ABCD
1$D$1:$D$4BB
2AA
3CC
4DD
Sheet6
Cell Formulas
RangeFormula
B1:B4B1=INDIRECT(A1)
Dynamic array formulas.
 
Upvote 0
Solution
If I were to put one of their letters in Cell A1, could the above formula be modified where the letter in A1 replaces the 'Fs' in the formula?
I'm not quite sure how that marked solution answers your question. :unsure:

Also, using ROWS($F$7:$F$264) seems to introduce a pointless calculation as that is simply 258

This is my suggestion (Only part data shown)

24 03 29.xlsm
ABCDEFGH
1HH24
2
3
4
5
6
7F7G7H7
8F8G8H8
9F9G9H9
10F10G10H10
11F11G11H11
12F12G12H12
13F13G13H13
14F14G14H14
15F15G15H15
16F16G16H16
17F17G17H17
18F18G18H18
19F19G19H19
20F20G20H20
21F21G21H21
22F22G22H22
23F23G23H23
24F24G24H24
25F25G25H25
26F26G26H26
27F27G27H27
28F28G28H28
29F29G29H29
30F30G30H30
rwmill9716
Cell Formulas
RangeFormula
B1B1=INDEX(INDIRECT(SUBSTITUTE("$#$7:$#$264","#",A1)),RANDBETWEEN(1,258))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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