I've been fiddling around with a certain document in Excel and I want to add a feature which I just can't seem to wrap my head around.
My doc randomly generates an integer in Cell A1 usingI have a list of text values in 100 cells [A2-A101] after that, and in a new cell B1 I want to display the content of whichever cell from the list of 100 corresponds to the randomly generated number in A1.=TRUNC(RAND()*(100-1)+1)
Is this possible? Is it, in fact, easy as pie?
Last edited by royUK; 01-24-2012 at 01:12 PM.
When you say text values you mean numbers from 1 to 100 yes? What your asking for is just returning the same number that is in A1 correct?
=VLOOKUP(A1;A2:A100;1;0)
If you just want to duplicate the number you could make B1=A1.
If I'm missing something could you post the spreadsheet? Did you want to know the cell reference instead?
Does this work:
=INDEX(A2:A100,A1)
Not quite. They're words. String values, I think they're often called?
Anyway, here's the sheet - I was using A1, A2 etc for simplicity's sake, the actual values are:
B7 - the random number generator
B22-B121 - The list of words
D7 - the place where I'd like the result
npc-personality-traits.xls
You need to use Index and Match.
The INDEX solution I put forward earlier works with words.
npc-personality-traits.xls
Hope this works I wrote this on calc but hopefully I changed all the ; to ,
Didn't seem to work basically here is the code=INDEX($B$22:$T$121,MATCH(B7,$A$22:$A$121,0),MATCH(C7,$B$20:$T$20,0))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks