Hello All,
Let's take the following data set:
Sheet1
<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Arial,Arial; FONT-SIZE: 10pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 64px"><COL style="WIDTH: 82px"><COL style="WIDTH: 82px"><COL style="WIDTH: 82px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD></TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">2</TD><TD style="FONT-WEIGHT: bold">Fruit</TD><TD style="FONT-WEIGHT: bold">January</TD><TD style="FONT-WEIGHT: bold">February</TD><TD style="FONT-WEIGHT: bold">March</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</TD><TD>Apple</TD><TD style="TEXT-ALIGN: right">13</TD><TD style="TEXT-ALIGN: right">-80</TD><TD style="TEXT-ALIGN: right">-41</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</TD><TD>Pear</TD><TD style="TEXT-ALIGN: right">-60</TD><TD style="TEXT-ALIGN: right">100</TD><TD style="TEXT-ALIGN: right">-77</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">5</TD><TD>Banana</TD><TD style="TEXT-ALIGN: right">57</TD><TD style="TEXT-ALIGN: right">-4</TD><TD style="TEXT-ALIGN: right">28</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">6</TD><TD>Orange</TD><TD style="TEXT-ALIGN: right">-32</TD><TD style="TEXT-ALIGN: right">100</TD><TD style="TEXT-ALIGN: right">97</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">7</TD><TD>Pineapple</TD><TD style="TEXT-ALIGN: right">93</TD><TD style="TEXT-ALIGN: right">0</TD><TD style="TEXT-ALIGN: right">15</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
And I am using the following formulas to return values for a specific month in descending order, as well as the corresponding "Fruit":
Sheet1
<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Arial,Arial; FONT-SIZE: 10pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 72px"><COL style="WIDTH: 82px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD></TD><TD>B</TD><TD>C</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">12</TD><TD style="FONT-WEIGHT: bold">Fruit</TD><TD style="FONT-WEIGHT: bold">February</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">13</TD><TD>Pear</TD><TD style="TEXT-ALIGN: right">100.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">14</TD><TD>Pear</TD><TD style="TEXT-ALIGN: right">100.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">15</TD><TD>Pineapple</TD><TD style="TEXT-ALIGN: right">0.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">16</TD><TD>Banana</TD><TD style="TEXT-ALIGN: right">-4.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">17</TD><TD>Apple</TD><TD style="TEXT-ALIGN: right">-80.0</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>B13</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C13,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C13)))}</TD></TR><TR><TD>C13</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C13))</TD></TR><TR><TD>B14</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C14,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C14)))}</TD></TR><TR><TD>C14</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C14))</TD></TR><TR><TD>B15</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C15,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C15)))}</TD></TR><TR><TD>C15</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C15))</TD></TR><TR><TD>B16</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C16,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C16)))}</TD></TR><TR><TD>C16</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C16))</TD></TR><TR><TD>B17</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C17,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C17)))}</TD></TR><TR><TD>C17</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C17))</TD></TR></TBODY></TABLE></TD></TR><TR><TD>Formula Array:
Produce enclosing { } by entering
formula with CTRL+SHIFT+ENTER!
</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
The values return correctly, but, where there are two Fruits with the exact same value, only one, "Pear", is returned.
How can I change the formula to return all the Fruits?
Moreover, if I wanted to exclude certain values, e.g. 0, or all negative values, how could this be ignored in the returned list?
Hope it's clear what I'm trying to do here.
Thanks a lot.
Matty
Let's take the following data set:
Sheet1
<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Arial,Arial; FONT-SIZE: 10pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 64px"><COL style="WIDTH: 82px"><COL style="WIDTH: 82px"><COL style="WIDTH: 82px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD></TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">2</TD><TD style="FONT-WEIGHT: bold">Fruit</TD><TD style="FONT-WEIGHT: bold">January</TD><TD style="FONT-WEIGHT: bold">February</TD><TD style="FONT-WEIGHT: bold">March</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</TD><TD>Apple</TD><TD style="TEXT-ALIGN: right">13</TD><TD style="TEXT-ALIGN: right">-80</TD><TD style="TEXT-ALIGN: right">-41</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</TD><TD>Pear</TD><TD style="TEXT-ALIGN: right">-60</TD><TD style="TEXT-ALIGN: right">100</TD><TD style="TEXT-ALIGN: right">-77</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">5</TD><TD>Banana</TD><TD style="TEXT-ALIGN: right">57</TD><TD style="TEXT-ALIGN: right">-4</TD><TD style="TEXT-ALIGN: right">28</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">6</TD><TD>Orange</TD><TD style="TEXT-ALIGN: right">-32</TD><TD style="TEXT-ALIGN: right">100</TD><TD style="TEXT-ALIGN: right">97</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">7</TD><TD>Pineapple</TD><TD style="TEXT-ALIGN: right">93</TD><TD style="TEXT-ALIGN: right">0</TD><TD style="TEXT-ALIGN: right">15</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
And I am using the following formulas to return values for a specific month in descending order, as well as the corresponding "Fruit":
Sheet1
<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Arial,Arial; FONT-SIZE: 10pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 72px"><COL style="WIDTH: 82px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD></TD><TD>B</TD><TD>C</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">12</TD><TD style="FONT-WEIGHT: bold">Fruit</TD><TD style="FONT-WEIGHT: bold">February</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">13</TD><TD>Pear</TD><TD style="TEXT-ALIGN: right">100.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">14</TD><TD>Pear</TD><TD style="TEXT-ALIGN: right">100.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">15</TD><TD>Pineapple</TD><TD style="TEXT-ALIGN: right">0.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">16</TD><TD>Banana</TD><TD style="TEXT-ALIGN: right">-4.0</TD></TR><TR style="HEIGHT: 17px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">17</TD><TD>Apple</TD><TD style="TEXT-ALIGN: right">-80.0</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>B13</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C13,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C13)))}</TD></TR><TR><TD>C13</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C13))</TD></TR><TR><TD>B14</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C14,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C14)))}</TD></TR><TR><TD>C14</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C14))</TD></TR><TR><TD>B15</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C15,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C15)))}</TD></TR><TR><TD>C15</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C15))</TD></TR><TR><TD>B16</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C16,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C16)))}</TD></TR><TR><TD>C16</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C16))</TD></TR><TR><TD>B17</TD><TD>{=INDEX(B$3:B$7,LARGE(IF(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0))=C17,ROW(B$3:B$7)-ROW(B$3)+1),COUNTIF($C$13:$C$17,C17)))}</TD></TR><TR><TD>C17</TD><TD>=LARGE(INDEX(C$3:E$7,,MATCH(C$12,C$2:E$2,0)),ROWS(C$13:C17))</TD></TR></TBODY></TABLE></TD></TR><TR><TD>Formula Array:
Produce enclosing { } by entering
formula with CTRL+SHIFT+ENTER!
</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
The values return correctly, but, where there are two Fruits with the exact same value, only one, "Pear", is returned.
How can I change the formula to return all the Fruits?
Moreover, if I wanted to exclude certain values, e.g. 0, or all negative values, how could this be ignored in the returned list?
Hope it's clear what I'm trying to do here.
Thanks a lot.
Matty