Excel公式来查找最接近的值
是否有可能通过公式find最接近的值(+或 – ),并在链接的Excel表中显示第一行值和第一列值?
例如:
search值是“7,30”(C12;variables可以请求表中的任何值)
find的行值是“7”(E12有公式,请参考A7)
find列值“4,00%”(E13,公式;以E1表示)
“F12”公式是可以的。 关于下表中的信息,“F13”中的公式可以是什么?
<head> <meta http-equiv=Content-Type content="text/html; charset=Windows-1254"> <meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 14"> <link rel=File-List href="SampleT_dosyalar/filelist.xml"> <style id="table-3_9841_Styles"> <!--table {mso-displayed-decimal-separator:"\,"; mso-displayed-thousand-separator:"\.";} .xl159841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl659841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:right; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl669841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:general; vertical-align:bottom; border:.5pt solid windowtext; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl679841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:Fixed; text-align:general; vertical-align:bottom; border:.5pt solid windowtext; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl689841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:"0\.00\\%"; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl699841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:general; vertical-align:bottom; background:#FFC000; mso-pattern:black none; white-space:nowrap;} .xl709841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:"0\.00\\%"; text-align:general; vertical-align:bottom; background:#FFC000; mso-pattern:black none; white-space:nowrap;} .xl719841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:"0\.00\\%"; text-align:general; vertical-align:bottom; border:.5pt solid windowtext; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl729841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:left; vertical-align:top; border:none; mso-diagonal-up:.5pt solid windowtext; mso-background-source:auto; mso-pattern:auto; white-space:normal;} .xl739841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:red; font-size:11.0pt; font-weight:700; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl749841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:#0070C0; font-size:11.0pt; font-weight:700; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl759841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:center; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl769841 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:162; mso-number-format:General; text-align:general; vertical-align:bottom; background:#D9D9D9; mso-pattern:black none; white-space:nowrap;} --> </style> </head> <body> <!--[if !excel]> <![endif]--> <!--Aşağıdaki bilgiler Microsoft Excel'in Web Sayfası Olarak Yayımlama sihirbazı tarafından oluşturuldu.--> <!--Aynı öğe Excel'den yeniden yayımlanırsa, DIV etiketleri arasındaki bilgilerin tümü değiştirilecek.--> <!-----------------------------> <!--EXCEL WEB SAYFASI OLARAK YAYIMLA SİHİRBAZI ÇIKTI BAŞLANGICI--> <!-----------------------------> <div id="table-3_9841" align=center x:publishsource="Excel"> <table border=0 cellpadding=0 cellspacing=0 width=1114 style='border-collapse: collapse;table-layout:fixed;width:836pt'> <col class=xl159841 width=26 style='mso-width-source:userset;mso-width-alt: 950;width:20pt'> <col class=xl159841 width=64 style='width:48pt'> <col width=64 span=16 style='width:48pt'> <tr class=xl159841 height=20 style='height:15.0pt'> <td height=20 class=xl769841 width=26 style='height:15.0pt;width:20pt'> </td> <td class=xl759841 width=64 style='width:48pt'>A</td> <td class=xl759841 width=64 style='width:48pt'>B</td> <td class=xl759841 width=64 style='width:48pt'>C</td> <td class=xl759841 width=64 style='width:48pt'>D</td> <td class=xl759841 width=64 style='width:48pt'>E</td> <td class=xl759841 width=64 style='width:48pt'>F</td> <td class=xl759841 width=64 style='width:48pt'>H</td> <td class=xl759841 width=64 style='width:48pt'>I</td> <td class=xl759841 width=64 style='width:48pt'>J</td> <td class=xl759841 width=64 style='width:48pt'>K</td> <td class=xl759841 width=64 style='width:48pt'>L</td> <td class=xl759841 width=64 style='width:48pt'>M</td> <td class=xl759841 width=64 style='width:48pt'>N</td> <td class=xl759841 width=64 style='width:48pt'>O</td> <td class=xl759841 width=64 style='width:48pt'>P</td> <td class=xl759841 width=64 style='width:48pt'>Q</td> <td class=xl759841 width=64 style='width:48pt'>R</td> </tr> <tr height=20 style='mso-height-source:userset;height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>1</td> <td rowspan=2 class=xl729841 width=64 style='width:48pt'><span style='mso-spacerun:yes'> </span>%<br> <span style='mso-spacerun:yes'> </span>Price</td> <td class=xl689841 align=right>1,00%</td> <td class=xl689841 align=right>2,00%</td> <td class=xl689841 align=right>3,00%</td> <td class=xl709841 align=right>4,00%</td> <td class=xl689841 align=right>5,00%</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>2</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>3</td> <td class=xl159841 align=right>3</td> <td class=xl159841 align=right><a name="RANGE!C4:G11">3,03</a></td> <td class=xl159841 align=right>3,06</td> <td class=xl159841 align=right>3,095</td> <td class=xl159841 align=right>3,125</td> <td class=xl159841 align=right>3,16</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>4</td> <td class=xl159841 align=right>4</td> <td class=xl159841 align=right>4,04</td> <td class=xl159841 align=right>4,08</td> <td class=xl159841 align=right>4,125</td> <td class=xl159841 align=right>4,165</td> <td class=xl159841 align=right>4,21</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>5</td> <td class=xl159841 align=right>5</td> <td class=xl159841 align=right>5,05</td> <td class=xl159841 align=right>5,1</td> <td class=xl159841 align=right>5,155</td> <td class=xl159841 align=right>5,21</td> <td class=xl159841 align=right>5,265</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>6</td> <td class=xl159841 align=right>6</td> <td class=xl159841 align=right>6,06</td> <td class=xl159841 align=right>6,12</td> <td class=xl159841 align=right>6,185</td> <td class=xl159841 align=right>6,25</td> <td class=xl739841 align=right>7,29</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>7</td> <td class=xl699841 align=right>7</td> <td class=xl159841 align=right>7,07</td> <td class=xl159841 align=right>7,145</td> <td class=xl159841 align=right>7,215</td> <td class=xl739841 align=right>7,29</td> <td class=xl159841 align=right>7,37</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>8</td> <td class=xl159841 align=right>8</td> <td class=xl159841 align=right>8,08</td> <td class=xl159841 align=right>8,165</td> <td class=xl159841 align=right>8,245</td> <td class=xl159841 align=right>8,335</td> <td class=xl159841 align=right>8,42</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>9</td> <td class=xl159841 align=right>9</td> <td class=xl159841 align=right>9,09</td> <td class=xl159841 align=right>9,185</td> <td class=xl159841 align=right>9,28</td> <td class=xl159841 align=right>9,375</td> <td class=xl159841 align=right>9,475</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>10</td> <td class=xl159841 align=right>10</td> <td class=xl159841 align=right>10,1</td> <td class=xl159841 align=right>10,205</td> <td class=xl159841 align=right>10,31</td> <td class=xl159841 align=right>10,415</td> <td class=xl159841 align=right>10,525</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>11</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>12</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl659841>Search:</td> <td class=xl679841 align=right>7,30</td> <td class=xl659841>Row</td> <td class=xl669841 align=right>7</td> <td class=xl159841 colspan=11><span style='mso-spacerun:yes'> </span>=İNDİS($A:$A;MAK((MİN(MUTLAK(DataRange-$C$12))=MUTLAK(DataRange-$C$12))*SATIR(DataRange)))</td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>13</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl659841>Column</td> <td class=xl719841 align=right style='border-top:none'>5,00%</td> <td class=xl159841 colspan=11><span style='mso-spacerun:yes'> </span>=İNDİS($1:$1;1;MAK((MİN(MUTLAK(DataRange-$C$12))=MUTLAK(DataRange-$C$12))*SÜTUN(DataRange)))</td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>14</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>15</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl749841 colspan=10>This formula is OK as row# "7" but is it possible to display "E7" instead of "F6" as column title?</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>16</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl749841 colspan=12>Can the formula check row# first to retrieve the colum title then check for others if no figure is identical in row "7" line?</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl759841 style='height:15.0pt'>18</td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> <td class=xl159841></td> </tr> <![if supportMisalignedColumns]> <tr height=0 style='display:none'> <td width=26 style='width:20pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> </tr> <![endif]> </table> </div> <!-----------------------------> <!--EXCEL WEB SAYFASI OLARAK YAYIMLA SİHİRBAZI ÇIKTI SONU--> <!-----------------------------> </body> </html>
这些公式必须是数组input的 :
Row: =INDEX($A:$A,MAX((MIN(ABS(DataRange-$C$12))=ABS(DataRange-$C$12))*ROW(DataRange))) Column: =INDEX($1:$1,1,MAX((MIN(ABS(DataRange-$C$12))=ABS(DataRange-$C$12))*COLUMN(DataRange)))
编辑:如果表中存在重复的可能性(与search值等距的两个值,则以下公式将确保Column
来自与find的行值相同的行。
Row: Formula in C12 Column: =INDEX($1:$1,1,MAX((MIN(ABS(INDEX(DataRange,E12-ROW(DataRange)+1,0)-$C$12))=ABS(INDEX(DataRange,E12-ROW(DataRange)+1,0)-$C$12))*COLUMN(DataRange)))
在你的例子中,
DataRange refers to: =Sheet1!$B$3:$F$10
要数组input公式,在将公式input单元格或公式栏后,按住ctrl + shift同时按Enter键 。 如果你这样做是正确的,Excel将把括号{...}放在公式的周围。
我想这个肯定有一个更漂亮的答案,但这对我有效:在E12把这个:
=ROUNDDOWN(C12,0)
在E13中,把这个Array-Formula(需要inputCtrl
+ Shift
+ Enter
而不是通常的Enter
):
=MATCH(MIN(ABS(C12-B3:F10)),ABS(C12-INDIRECT(CONCATENATE("B",E12)):INDIRECT(CONCATENATE("F",E12))),0)
希望这可以帮助
在E12中,该行:
=INDEX(A:A,AGGREGATE(15,6,($B$3:$F$10)/(AGGREGATE(15,6,ABS(C12-$B$3:$F$10),1)=ABS(C12-$B$3:$F$10)),1))
在E13中,列:
=INDEX(1:1,AGGREGATE(15,6,COLUMN($B$3:$F$10)/(AGGREGATE(15,6,ABS(C12-$B$3:$F$10),1)=ABS(C12-$B$3:$F$10)),1))