请教excel公式的拼接

发布网友 发布时间:2022-04-22 07:12

我来回答

3个回答

热心网友 时间:2022-06-17 07:46

'自定义公式-按ALT+11-插入-模块
Function abc(a As Range, b As Range, c As String, Optional d As String = "+")
If a.Rows.Count <> b.Rows.Count Then abc = "错误": Exit Function
If c = "" Then
abc = "请在A1输入值"
Else
Set Ra = a.Find(c)
If Not Ra Is Nothing Then
For i = 1 To a.Rows.Count

If a.Cells(i, 1) = c Then t = t & d & b.Cells(i, 1)
If a.Cells(i, 1) = "" Then Exit For
Next
abc = Right(t, Len(t) - 1)
Else
abc = ""
End If
End If
End Function

热心网友 时间:2022-06-17 07:46

如果365版或2019,E2{=TEXTJOIN("+",TRUE,IF($A$1:$A$20=D3,$B$1:$B$20,""))}

如果2016,E2

{=LEFT(CONCAT(IF($A$1:$A$20=D2,$B$1:$B$20&"+","")),LEN(CONCAT(IF($A$1:$A$20=D2,$B$1:$B$20&"+","")))-1)}    

都是数组公式,输入大括号中的内容,然后按ctrl_shift_回车

热心网友 时间:2022-06-17 07:46

=TEXTJOIN("+",1,SUBSTITUTE(IF($C$12:$C$15=F12,$D$12:$D$15),"FALSE",""))

输入公式后 需要按 CTRL+SHIFT+ENTER  组合键

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com