Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the complianz-gdpr domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/gayhajvi/my-sanfrancisco.life/wp-includes/functions.php on line 6114
Random Tech | My San Francisco Life

How to create a formula to get a random text value from a list of cells in a spreadsheet

[wp_table id=702/]


In the table above, I wanna know who I should call to hang out with on Friday night. I want the computer to pick a random dude from the spreadsheet. The formula below shows how we are going to do this.

=INDEX(list of dudes, RANDBETWEEN(1, ROWS(list of dudes)),1)

The RANDBETWEEN() picks a number between 1 and the number of rows in the sheet.

The index() tasks that number and finds the row and returns the data in the first column (that’s what the 1 is doing at the very end.

Let’s get the values for the data range in there:

=INDEX($A$1:$A$8,RANDBETWEEN(1,ROWS($A$1:$A$8)),1

You could replace the $A$1:$A$8 with a named range if working in excel (I’m not)

And the answer (tonight) is Francisco.