Convert array to string via formula

CodeNinja

Well-known Member
Joined
Feb 18, 2013
Messages
644
I have a series of if/then conditions I need to concatenate... Rather than have a long formula of concatenate(if(a2="fail",a1,""),if(b2="fail",b1,""),......) I would like to do an array formula {=Concatenate(if(A2:R2="Fail",$C$1:$R$1,""))} Unfortunately concatenate only sees the first result in the array... When I evaluate the if then portion, I get {"","",Cell$C$1,"",""...) but the concatenation will not joint them together. I tested this by using the formula {=concatenate({"Yes","No"})} and got Yes as my answer...

Any ideas how to make this work the way I want?

Thanks,

CN.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Nevermind, I just wrote a user defined function that handles this...

Function cCat(rngTest As Range, sCondition As String, rngResult As Range) As String
Dim i As Integer
For i = 1 To rngTest.Cells.Count
If rngTest(i) = sCondition Then
cCat = cCat & rngResult(i) & ", "
End If
Next i
End Function
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,239
Members
448,879
Latest member
VanGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top