问题描述
如果同一行的H中的单元格等于No Company,我想获得列J的不同列表。
I would like to get a distinct list of column J if cell in H of same row equals "No Company".
我试过= IFERROR(INDEX($ J $ 2:$ J $ 10,MATCH(0,COUNTIF($ K $ 1:K2,$ J $ 2:$ J $ 10& amp; ;)+ IF(ISTEXT($ H $ 2:$ H $ 10)=没有公司,1,0),0)),))
I tried =IFERROR(INDEX($J$2:$J$10, MATCH(0, COUNTIF($K$1:K2, $J$2:$J$10&"") + IF(ISTEXT($H$2:$H$10)="No company",1,0), 0)), ""))
也试过= IFERROR(指数(J $ 2:J $ 400,小(IF((H $ 2:H $ 400 =无公司)> 1)),行(j $ 2:j $ 400)-ROW(j $ 2)+1) ,ROWS(j $ 2:j2)),)更改一些字段但没有运气
also tried =IFERROR(INDEX(J$2:J$400, SMALL(IF((H$2:H$400=No company)>1)), ROW(j$2:j$400)-ROW(j$2)+1), ROWS(j$2:j2)), "") changing some of the fields but no luck
推荐答案
创建新功能:
打开VBA编辑器(alt + F11),添加新模块,插入代码:
Create a new function:open VBA Editor (alt + F11), add new module, insert code:
Function JoinAll(ByRef range As range, ByVal delimiter As String)
For Each c In range.Cells
If InStr(JoinAll, c.Value) = 0 Then
JoinAll = JoinAll + c.Value + delimiter
End If
Next
JoinAll = Left(JoinAll, Len(JoinAll) - Len(delimiter))
End Function
使用如下公式:
=JoinAll(J2:J10, ", ")
这篇关于如果相邻值等于excel中的特定文本,则获取不同的列表(索引)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!