PDA

View Full Version : counting data



wiganbhoy
03-09-2009, 04:25 AM
I am trying to get some form of count feature in a spread shee. It is a column which has up to 1000 entries of postcodes which I need to know how many of each particular postcode is in the list. The actual postcodes can be numerous as well so time consuming at the moment to count individually. Please can you help:(

Bob Phillips
03-09-2009, 05:25 AM
=COUNTIF(A:A,"postcode")

wiganbhoy
03-09-2009, 05:43 AM
This puts a ) in the field what I needs is for example a field saying
4 fk1o 1wd
2 sk13 1ws

etc.
So they count the number of all of each postcode as could be maybe 11 of one 2 of aother etc. Its jus such a long list and the data is needed to pass on. I am a complete excel novice so sorry if not explaining myself right

thx

Bob Phillips
03-09-2009, 05:47 AM
Do you already have the list of codes elsewhere on the sporeadsheet?

mdmackillop
03-09-2009, 05:52 AM
Option Explicit
Sub Macro1()
Dim Rng As Range
Range("A:A").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"D1"), Unique:=True
Range("E1") = "Count"
Range("E1").Font.Bold = True

Set Rng = Range(Cells(2, 4), Cells(2, 4).End(xlDown)).Offset(, 1)
Rng.FormulaR1C1 = "=COUNTIF(C[-4],RC[-1])"

End Sub