EXCEL SUM TEXT

A B C D
1 100 1 =SUMIF(A:A,C1,B:B)
2 10
1 25

I GOT RESULT 125 IN 'D1' CELL

A B C D
1 ABCD 1
2 KLMN
1 EF

LIKE ABOVE I WANT RESULT 'ABCDEF' IN 'D1' CELL WHICH EQUATION FOR IT?

Created UDF Function 

Step 1: Press ALT + F11 and paste the below code and save as excel macro workbook.

Public Function concateif(a As Range, b As String, c As Range)
    For Each cell In a
      If cell = b Then
        f = f & c.Cells(cell.Row)
      End If
    Next
    concateif = f
End Function

Step 2:

In Cell D1, add the below formula

=concateif(A1:A3,C1,B1:B3) 

it will return the result as expected.

If solved, please mark it as "Answers" & "Helpful". Thanks.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated July 12, 2018 Views 41 Applies to: