jasonkgreen
Board Regular
- Joined
- Feb 21, 2013
- Messages
- 50
I have a table of 1500 records. I want to populate a column with random states. My table with 1500 records has a region field already populated (Northeast, South, Midwest, West). I have another table with a list of the 50 states + DC each with a corresponding region (same as those listed above).
I found a formula that will return a random value from a list, but I need a qualifier to match the regions from each table and then return a random state where the regions match.
Suggestions?
=INDEX(data,RANDBETWEEN(1,ROWS(data)),1)
Using this table (partial table shown)
I found a formula that will return a random value from a list, but I need a qualifier to match the regions from each table and then return a random state where the regions match.
Suggestions?
=INDEX(data,RANDBETWEEN(1,ROWS(data)),1)
id | customer | revenue | support | region | industry | State |
1 | 1 | $3,787 | 3 | West | 1 | Populate random state here |
2 | 1 | $1,734 | 3 | South | 2 | |
3 | 2 | $2,126 | 3 | West | 1 | |
4 | 2 | $2,259 | 3 | West | 2 | |
5 | 2 | $1,587 | 4 | Northeast | 1 | |
6 | 1 | $0 | 4 | West | 3 | |
7 | 2 | $1,838 | 4 | South | 1 | |
8 | 1 | $1,847 | 4 | West | 1 | |
9 | 1 | $1,714 | 2 | Midwest | 3 | |
10 | 2 | $1,718 | 4 | South | 3 | |
11 | 2 | $4,388 | 1 | West | 1 | |
12 | 2 | $3,155 | 1 | Northeast | 2 | |
13 | 2 | $3,834 | 4 | West | 1 | |
14 | 2 | $2,291 | 4 | Northeast | 2 | |
15 | 2 | $4,140 | 2 | South | 2 | |
16 | 2 | $2,194 | 2 | South | 3 | |
17 | 2 | $2,938 | 2 | South | 1 | |
18 | 1 | $3,313 | 4 | Midwest | 2 | |
19 | 2 | $3,327 | 4 | Midwest | 3 | |
20 | 1 | $1,449 | 2 | Midwest | 1 |
Using this table (partial table shown)
State | State Code | Region |
Alaska | AK | West |
Alabama | AL | South |
Arkansas | AR | South |
Arizona | AZ | West |
California | CA | West |
Colorado | CO | West |
Connecticut | CT | Northeast |
District of Columbia | DC | South |
Delaware | DE | South |
Florida | FL | South |
Georgia | GA | South |
Hawaii | HI | West |
Iowa | IA | Midwest |
Idaho | ID | West |
Illinois | IL | Midwest |
Indiana | IN | Midwest |
Kansas | KS | Midwest |
Kentucky | KY | South |
Louisiana | LA | South |