A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Concatenate formula



 
 
Thread Tools Display Modes
  #1  
Old November 11th, 2009, 03:30 AM posted to microsoft.public.excel.misc
Bricky
external usenet poster
 
Posts: 6
Default Concatenate formula

I'm trying to get a formula using concatenate that will identify numbers in a
row 3 (4&5) and returning the name of the column above into one cell.

Big small large larger
1 4 5 2

So in one cell I should get [small, large]
I can get this when only looking at one cell but not when I’m trying to look
a multiple ones.

  #2  
Old November 11th, 2009, 05:37 AM posted to microsoft.public.excel.misc
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default Concatenate formula

With data arranged as below; try the below user defined formula

Col A Col B Col C Col D
bg small large larger
2 3 4 1

Try this UDF (User Defined function). From workbook launch VBE using
Alt+F11. From menu Insert a Module and paste the below function.Close and get
back to workbook and try the below formula.

=HLOOKUP_CONCAT(A22,A11)

Function HLOOKUP_CONCAT(lookup_Range As Range, ret_Range As Range)
Dim lngCol As Long
For lngCol = 1 To lookup_Range.Columns.Count
If lookup_Range(lngCol) = 3 Then HLOOKUP_CONCAT = _
HLOOKUP_CONCAT & "," & ret_Range(lngCol)
Next
HLOOKUP_CONCAT = Mid(HLOOKUP_CONCAT, 2)
End Function


If this post helps click Yes
---------------
Jacob Skaria


"Bricky" wrote:

I'm trying to get a formula using concatenate that will identify numbers in a
row 3 (4&5) and returning the name of the column above into one cell.

Big small large larger
1 4 5 2

So in one cell I should get [small, large]
I can get this when only looking at one cell but not when I’m trying to look
a multiple ones.

  #3  
Old November 12th, 2009, 08:53 PM posted to microsoft.public.excel.misc
Bricky
external usenet poster
 
Posts: 6
Default Concatenate formula

Thanks Jacob, unfortunately this is picking up all the data in row A11? Not
only values greater than 3.
Other than that works fine.

cheers Bricky

"Jacob Skaria" wrote:

With data arranged as below; try the below user defined formula

Col A Col B Col C Col D
bg small large larger
2 3 4 1

Try this UDF (User Defined function). From workbook launch VBE using
Alt+F11. From menu Insert a Module and paste the below function.Close and get
back to workbook and try the below formula.

=HLOOKUP_CONCAT(A22,A11)

Function HLOOKUP_CONCAT(lookup_Range As Range, ret_Range As Range)
Dim lngCol As Long
For lngCol = 1 To lookup_Range.Columns.Count
If lookup_Range(lngCol) = 3 Then HLOOKUP_CONCAT = _
HLOOKUP_CONCAT & "," & ret_Range(lngCol)
Next
HLOOKUP_CONCAT = Mid(HLOOKUP_CONCAT, 2)
End Function


If this post helps click Yes
---------------
Jacob Skaria


"Bricky" wrote:

I'm trying to get a formula using concatenate that will identify numbers in a
row 3 (4&5) and returning the name of the column above into one cell.

Big small large larger
1 4 5 2

So in one cell I should get [small, large]
I can get this when only looking at one cell but not when I’m trying to look
a multiple ones.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.