Concatenate values IF()
On May 7, 12:32 pm, Gary''s Student
wrote:
Try this UDF:
Function list_um(rr As Range) As String
list_um = ""
gotit = False
For Each r In rr
If IsEmpty(r) Or r.Value = "" Then
Else
If gotit Then
list_um = list_um & "," & r.Value
Else
gotit = True
list_um = r.Value
End If
End If
Next
End Function
use it like:
=list_um(W25:W41)
--
Gary''s Student - gsnu200719
~~Okay, another hitch that might make this problem a bit harder to
solve~~
There is also an "Other" box that, when checked, links a series of
values (or just one value), formatted as text (comma or comma-space
delimited), to W43. These values are supposed to be the values
available in addition to the values returned from the excellent UDF
recently provided.
Now, I'd like to put these "values" in order, if that's possible. For
example, returned from the UDF is:
"0.5, 0.625, 1, 2, 3.75, 4, 6, 7, 7.5, 8, 9"
Returned in W43:
"2.4, 6.7" -- or any other user-defined string
I'd like to return a text string with all the values combined - in
numerical order:
"0.5, 0.625, 1, 2, 2.4, 3.75, 4, 6, 6.7, 7, 7.5, 8, 9"
What makes this difficult to solve in my mind is putting values in
numerical order if they're interpreted as text...
Would this require another UDF or could it be done with various Text
Functions?
Thank you again for all your help,
Nikki
|