Welcome to the Board!
Try this:
=LOOKUP(RANDBETWEEN(0,13), {0,1,6}, {"Yellow","Red","Green"})
Note that a function like this is volatile, so it refreshes everytime the sheet recalculates.
The problem with that method is lack of consistancy with the number of marbles in the jar, if you draw 3 or 4 marbles from the second jar, this could give you more than 1 yellow.
Also (0,13) gives 14 choices, not 13.
Probably a more reliable method wold be to create a list of the contents of the jar (column A) and a list of random numbers (column C) then use the sort order of the random list to make the draw (done with index and rank in column E).
Using RAND() is still volatile so will change every time the sheet is calculated, this can be stopped if needed using iterative calculation.
<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Calibri,Arial; FONT-SIZE: 11pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">1</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Yellow</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.364464</TD><TD> </TD><TD>Green</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">2</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.065807</TD><TD> </TD><TD>Red</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.226525</TD><TD> </TD><TD>Red</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.536873</TD><TD> </TD><TD>Green</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">5</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.554253</TD><TD> </TD><TD>Green</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">6</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.726692</TD><TD> </TD><TD>Green</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">7</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.012525</TD><TD> </TD><TD>Red</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">8</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Green</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.639015</TD><TD> </TD><TD>Green</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">9</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Red</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.320179</TD><TD> </TD><TD>Red</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">10</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Red</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.877782</TD><TD> </TD><TD>Yellow</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">11</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Red</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.353256</TD><TD> </TD><TD>Red</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">12</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Red</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.52616</TD><TD> </TD><TD>Green</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">13</TD><TD style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Red</TD><TD> </TD><TD style="TEXT-ALIGN: right">0.551383</TD><TD> </TD><TD>Green</TD></TR></TBODY></TABLE>
<TABLE style="BORDER-BOTTOM-STYLE: groove; BORDER-BOTTOM-COLOR: #00ff00; BORDER-RIGHT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-TOP-STYLE: groove; COLOR: #000000; BORDER-RIGHT-COLOR: #00ff00; FONT-SIZE: 10pt; BORDER-LEFT-STYLE: groove; BORDER-LEFT-COLOR: #00ff00"><TBODY><TR><TD>
Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-FAMILY: Arial; FONT-SIZE: 9pt" border=1 cellSpacing=0 cellPadding=2><TBODY><TR style="BACKGROUND-COLOR: #cacaca; FONT-SIZE: 10pt"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>C1</TD><TD>=RAND()</TD></TR><TR><TD>E1</TD><TD>=INDEX($A$1:$A$13,RANK
(C1,$C$1:$C$13,0))</TD></TR><TR><TD>C2</TD><TD>=RAND()</TD></TR><TR><TD>E2</TD><TD>=INDEX($A$1:$A$13,RANK
(C2,$C$1:$C$13,0))</TD></TR><TR><TD>C3</TD><TD>=RAND()</TD></TR><TR><TD>E3</TD><TD>=INDEX($A$1:$A$13,RANK
(C3,$C$1:$C$13,0))</TD></TR><TR><TD>C4</TD><TD>=RAND()</TD></TR><TR><TD>E4</TD><TD>=INDEX($A$1:$A$13,RANK
(C4,$C$1:$C$13,0))</TD></TR><TR><TD>C5</TD><TD>=RAND()</TD></TR><TR><TD>E5</TD><TD>=INDEX($A$1:$A$13,RANK
(C5,$C$1:$C$13,0))</TD></TR><TR><TD>C6</TD><TD>=RAND()</TD></TR><TR><TD>E6</TD><TD>=INDEX($A$1:$A$13,RANK
(C6,$C$1:$C$13,0))</TD></TR><TR><TD>C7</TD><TD>=RAND()</TD></TR><TR><TD>E7</TD><TD>=INDEX($A$1:$A$13,RANK
(C7,$C$1:$C$13,0))</TD></TR><TR><TD>C8</TD><TD>=RAND()</TD></TR><TR><TD>E8</TD><TD>=INDEX($A$1:$A$13,RANK
(C8,$C$1:$C$13,0))</TD></TR><TR><TD>C9</TD><TD>=RAND()</TD></TR><TR><TD>E9</TD><TD>=INDEX($A$1:$A$13,RANK
(C9,$C$1:$C$13,0))</TD></TR><TR><TD>C10</TD><TD>=RAND()</TD></TR><TR><TD>E10</TD><TD>=INDEX($A$1:$A$13,RANK
(C10,$C$1:$C$13,0))</TD></TR><TR><TD>C11</TD><TD>=RAND()</TD></TR><TR><TD>E11</TD><TD>=INDEX($A$1:$A$13,RANK
(C11,$C$1:$C$13,0))</TD></TR><TR><TD>C12</TD><TD>=RAND()</TD></TR><TR><TD>E12</TD><TD>=INDEX($A$1:$A$13,RANK
(C12,$C$1:$C$13,0))</TD></TR><TR><TD>C13</TD><TD>=RAND()</TD></TR><TR><TD>E13</TD><TD>=INDEX($A$1:$A$13,RANK
(C13,$C$1:$C$13,0))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4