显示数据相对于相邻列移动的行数


0

我在列中有一个文本条目列表 AB

enter image description here

在专栏中 C 我想显示列的条目有多少行 B 与列中的行有所不同 A

行差异可以是正的也可以是负的(即数据可以向上或向下移动行)。

Answers:


1

如果列A中有列表,而列B中有新列表,则在CELL C1中可以应用以下公式,然后向下拖动。

=IFERROR(MATCH(A1,B:B,0)-ROW(A1),"")

enter image description here

正数表示行向下移动,负向上。要扭转这种用途:

=IFERROR(ROW(A1)-MATCH(A1,B:B,0),"")

编辑。根据评论

按要求查看新配方。

=IFERROR(IF(MATCH(A1,B:B,0)-ROW(A1)=0,"Did Not Move","Moved "&MATCH(A1,B:B,0)-ROW(A1)&" Rows "&IF(MATCH(A1,B:B,0)-ROW(A1)<0,"Down",IF(MATCH(A1,B:B,0)-ROW(A1)>0,"Up",""))),"Not Found In Column A")

谢谢Peter @PeterH,我已经编辑了我的问题,以便更清楚地了解我想要实现的目标
GovVek

@GovVek看到更新
PeterH
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.