简体   繁体   English

Excel公式-索引匹配地址间接rank.avg

[英]Excel formula - index match address indirect rank.avg

Need help crafting formula. 需要帮助制定配方。

I have data in SQL, exporting to excel. 我在SQL中有数据,可以导出到excel。 In excel have formula's to determine rank of parts based on values in a certain week in a range/array. 在excel中,公式可以根据范围/数组中某一星期的值确定零件的等级。 The columns are weekly buckets, and each time I export, the weekly buckets change (no dates in the past). 这些列是每周的存储区,每次我导出时,每周的存储区都会更改(过去没有日期)。 I would like the rank to remain fixed a specific date, but each export per week the specific column comes inward by 1 column. 我希望排名可以固定一个特定的日期,但是每周的每个出口中,特定列排在第一列。

I need an excel formula which finds the position of the specific value in the weekly bucket array. 我需要一个Excel公式,该公式可以在每周存储区数组中找到特定值的位置。 After this is determined, I need another formula to convert this column address (eg "AX") to be referenced by the rank.avg function. 确定之后,我需要另一个公式来转换该列地址(例如“ AX”)以供rank.avg函数引用。

I am guessing this is some combination of match, index, cell, indirect, & rank.avg. 我猜这是匹配,索引,单元格,间接和rank.avg的某种组合。 So far I have tried just the first part and cannot get cell("col",(index(match))) to return the letter values of the column it is in. It returns the # of the column instead. 到目前为止,我仅尝试了第一部分,但无法使cell(“ col”,(index(match)))返回其所在列的字母值。而是返回该列的#。

Here is example 这是例子

  A       B        C         D
1 Part    Rank(C)  11/28/17  12/04/17
2 Part A  1        $100      $100    
3 Part B  2        $50       $125    
4 Part C  3        $25       $200    

Column B has the rank formula which is determining the rank of the parts (A,B,C) from column C. Column C is determining from hardcoding go to the value 11/28/17. B列具有等级公式,该公式确定了C列中零件(A,B,C)的等级。C列通过硬编码确定值11/28/17。

I am stuck at =CELL("address",INDEX(C1:D1,1,MATCH(43067,C1:D1,0))). 我被困在= CELL(“ address”,INDEX(C1:D1,1,MATCH(43067,C1:D1,0)))处。 This returns $C$1 when I just want $C or just C. Afterwards I intend to use this with indirect to be able to pass it through the rank function. 当我只想要$ C或C时,它将返回$ C $ 1。之后,我打算将它与间接函数一起使用,以使其能够通过rank函数传递。 Any assistance would be greatly appreciated where someone can fill the gap on the formula or come up with an easier way to do this. 如果有人可以填补公式上的空白或想出一种更简单的方法,将不胜感激。

Nick 缺口

Yes get rid of ADDRESS and INDIRECT and just put the column in a COUNTIF formula. 是的,请删除ADDRESS和INDIRECT,然后将其放在COUNTIF公式中。

ADDRESS and INDIRECT are volatile. ADDRESS和INDIRECT易失。 This is an non-Volatile and non-Array formula that does what you want in one step: 这是一个非易失性和非数组公式,可一步完成您想要的操作:

=COUNTIF(INDEX(C:D,2,MATCH(43067,$C$1:$D$1,0)):INDEX(C:D,1040000,MATCH(43067,$C$1:$D$1,0)),">" & INDEX(C:D,ROW(),MATCH(43067,$C$1:$D$1,0))) + 1

在此处输入图片说明

To get just the column letter you could get fancy with Address and Substitute : 只获取专栏字母,您可能会对AddressSubstitute

=SUBSTITUTE(ADDRESS(1,MATCH(43067, C1:D1,0)+2,4), "1", "")

Address takes in a column and row and spits out a cell. 地址接受一列和一行,并吐出一个单元格。 So we just always reference row 1 and whatever column is returned from address ( +2 since we are starting at C in Match). 因此,我们始终仅引用行1,并从地址返回任何列(由于我们从Match中的C开始,所以返回+2 )。 Then we substitute out the 1 from the returned cell address with nothing to be left with the column letter. 然后,我们用返回的单元格地址中的1替换掉列字母中没有的任何内容。

Well, if your formula returns cell reference in form of C1 you can wrap it with: 好吧,如果您的公式以C1形式返回单元格引用,则可以使用以下代码进行包装:

=CHAR(64+COLUMN(C1))

Just change C1 with your formula. 只需使用您的公式更改C1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM