From: UlvaZell on
Is there a text function counterpart to the SUMIF. A concatenate if? I have
a table of data and based upon a numeric value in the data I would like to
concatenate all of the text strings that might be assocaited with all of the
instances of a given numeric value...
From: Bernard Liengme on
Starting in A1, I have
cat 4 catrat
dog 5rat 4
The formula in C1 is =Tryme(A1:B3,4)
The UDF code is given below
---------
Function tryme(myrange, myvalue)
mylast = myrange.Count
For j = 1 To mylast
If myrange(j, 2) = myvalue Then
mystring = mystring & myrange(j, 1)
End If
Next j
tryme = mystring
End Function
--------------------------
If you data is arranged differently let me know and I will adjust the code
If you are unfamiliar with VBA see one or more of these
David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

Jon Peltier's site:
http://peltiertech.com/WordPress/2008/03/09/how-to-use-someone-elses-macro/

(General, Regular and Standard modules all describe the same thing.)

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"UlvaZell" <UlvaZell(a)discussions.microsoft.com> wrote in message
news:DE7A2315-FFA6-450F-8739-9DCF7EB87C94(a)microsoft.com...
> Is there a text function counterpart to the SUMIF. A concatenate if? I
> have
> a table of data and based upon a numeric value in the data I would like to
> concatenate all of the text strings that might be assocaited with all of
> the
> instances of a given numeric value...

 | 
Pages: 1
Prev: Matching Data
Next: Prevent dragging cell contents