Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Matching & adding text in the respective column

I have text data in following way

high india
high australia
low russia
medium france
medium italy
low germany
high spain

Now in a separate sheet, I need result for high, medium & low by adding the
respective text of the same such as follows

High india australia spain
medium france italy
low russia germany

Can u help me phrasing the formula for the same ?



--
ashutosh
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Matching & adding text in the respective column

for this particular case you might use the following function:

Function conn(rg As Range, lev As String) As String
Dim counter As Integer

For Each cell In rg.Columns(1).Cells
If cell.Value = lev Then
counter = counter + 1
If counter 1 Then
conn = conn & ", " & cell.Offset(0, 1).Value
Else
conn = cell.Offset(0, 1).Value
End If
End If
Next cell

End Function

press ALT+F11 to get to Visual Basic window, then Insert-Module,
paste the code into the module
then come back to yr worksheet and insert =conn(your_range,A1) where
A1="low", A2="medium...

copy down

adjust your ranges/addresses to suit

pls click YES if this helped



On 23 Kwi, 12:14, ashutosh wrote:
I have text data in following way

high * * * * * *india * * * * * * *
high * * * * * *australia
low * * * * * * russia
medium * * * france
medium * * * italy
low * * * * * * germany
high * * * * * *spain

Now in a separate sheet, I need result for high, medium & low by adding the
respective text of the same such as follows

High * * * *india australia spain
medium * france italy
low * * * * *russia germany

Can u help me phrasing the formula for the same ?

--
ashutosh


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
When i am at a cell, how can i highlight respective row and column Denish Excel Discussion (Misc queries) 4 April 17th 09 01:50 PM
adding * to text to column Jeff Excel Discussion (Misc queries) 4 December 16th 08 10:01 PM
Column Chart - Adding text in the column in Excel 2007 Jennifer Charts and Charting in Excel 2 July 26th 08 02:58 PM
Count matching text in column Tom Excel Discussion (Misc queries) 1 September 29th 07 09:08 AM
Looking up data in a column, then returning values of respective row TC Excel Discussion (Misc queries) 4 March 22nd 06 02:47 PM


All times are GMT +1. The time now is 02:40 AM.

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"