Extracting Text From a Column

skuddyb

New Member
Joined
Sep 29, 2015
Messages
39
Hi Guys,


I basically have a column of data made up of 0's and names of places.

In the column adjacent and to the right of it I wish to return all of the words in the column but not the 0's. If possible I want to be able to return only one of each individual word and then in the cell adjacent to this (2 columns over from the original data) tally them up


Original DataPlacesNumber of.
GlasgowGlasgow3
0London2
LondonBirmingham2
London
Birmingham
0
Glasgow
Birmingham
Glasgow

<tbody>
</tbody>


This is what I want it to look like in the end, although i have thousands of bits of data in column 1.

if anyone could help out with this i'd be grateful!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try this short macro:
Code:
Sub Consolidatee()
   Dim i As Long, j As Long, N As Long, c As Collection
   Dim v As String, wf As WorksheetFunction
   Set wf = Application.WorksheetFunction
   Set c = New Collection
   N = Cells(Rows.Count, "A").End(xlUp).Row
   j = 2
   On Error Resume Next
   
   For i = 2 To N
      v = Cells(i, 1).Text
      If v <> "0" Then
         c.Add v, CStr(v)
         If Err.Number = 0 Then
            Cells(j, 2).Value = v
            Cells(j, 3).Value = wf.CountIf(Range("A1:A" & N), v)
            j = j + 1
         Else
            Err.Number = 0
         End If
      End If
   Next i
End Sub
 
Upvote 0
Hi,

I managed to use this formula to get it to return individual values in the adjacent column:

=INDEX($BB$2:$BB$10000, MATCH(0, COUNTIF($BC$1:BC1, $BB$2:$BB$10000), 0))

Now in the next column "BD" I wish it to return the number of times the text appeared in column "BB", what do i need for this?
 
Upvote 0
Original DataPlacesNumber of.
GlasgowGlasgow3
0London2
LondonBirmingham2
London
Birmingham
0Count of Original Data
GlasgowOriginal DataTotal
BirminghamBirmingham2
GlasgowGlasgow3
London2
Grand Total7
a simple pivot table applied to column A

<colgroup><col><col><col><col span="3"><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top