#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
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 Im trying to look
a multiple ones.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
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(A2:D2,A1:D1)

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 Im trying to look
a multiple ones.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Concatenate formula

Thanks Jacob, unfortunately this is picking up all the data in row A1:D1? 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(A2:D2,A1:D1)

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 Im trying to look
a multiple ones.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate formula Bricky Excel Discussion (Misc queries) 0 November 11th 09 03:30 AM
Concatenate a formula Steven Excel Worksheet Functions 1 July 23rd 08 04:17 AM
Concatenate Formula doesn't do its job... Felix Excel Discussion (Misc queries) 4 December 28th 07 11:39 AM
Concatenate formula help please ferde Excel Discussion (Misc queries) 3 August 26th 07 05:57 AM
Evaluating results of a concatenate formula, as a formula dodger Excel Worksheet Functions 5 September 9th 05 01:55 PM


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

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

About Us

"It's about Microsoft Excel"