Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Merge columns into single list and replace with count of occurrences

Hi

This is sample data set:
A B C
123 112 146
234 123 567
345 134 345
456 156 322
567 456
678
789

I want to end up with:

A B C
123 x
234 x
345 x x
456 x x
678 x
789 x
112 x
134 x
156 x
146 x
567 x x
322 x


Please help. Does anyone know of a tool that will do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Merge columns into single list and replace with count of occurrences


Uzytkownik napisal w wiadomosci
ps.com...
Hi

This is sample data set:
A B C
123 112 146
234 123 567
345 134 345
456 156 322
567 456
678
789

I want to end up with:

A B C
123 x
234 x
345 x x
456 x x
678 x
789 x
112 x
134 x
156 x
146 x
567 x x
322 x


Please help. Does anyone know of a tool that will do this?


try
Sub x()

Dim zakres As Range, kom As Range
Dim zakladka As Worksheet
Dim tablica() As Variant
Dim i As Integer, j As Integer, w As Integer

i = 1

Set zakres = Selection
For Each kom In zakres
ReDim Preserve tablica(i)
tablica(i) = kom.Value
i = i + 1
Next kom

w = 1
For j = 1 To UBound(tablica)
If WorksheetFunction.CountIf(Columns(5), tablica(j)) = 0 Then
Cells(w, 5).Value = tablica(j)
Cells(w, 6).Value = WorksheetFunction.Rept("x",
WorksheetFunction.CountIf(Selection, tablica(j)))
w = w + 1
End If
Next j
End Sub

it works on selection and inset the list in column E & F - change it to your
needs
mcg


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
Mulitiple Count of occurrences in different columns Ant Excel Worksheet Functions 3 June 3rd 09 08:34 PM
merge columns into single report - macro needed aquaflow Excel Discussion (Misc queries) 2 February 5th 07 12:41 PM
How to count occurrences where 2 columns are required to be true? Brandoni Excel Worksheet Functions 1 November 4th 06 01:26 PM
Sum Count of Single Criteria in Multiple Non-Adjacent columns Sam via OfficeKB.com Excel Worksheet Functions 9 July 14th 05 10:01 PM
merge data from multiple columns to single column triggerthehorse Excel Worksheet Functions 2 January 17th 05 07:19 PM


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

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

About Us

"It's about Microsoft Excel"