Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Molochi
 
Posts: n/a
Default Counting the Contents of Two Columns

Hi

I'm setting up a spreadsheet and will have two columns of text... so for
instance columns A1:A5 could contain

Andy
Bob
Chris
Dave
Eddie

while columns D1:D5 could contain
Andy
Bill
Colin
Dave
Eric

What I want to do is find a way of doing a count of the number of
occurrences a name appears across BOTH columns. I can do it down a single
column with a Pivotable, but is there an easy way to do it down multiple
columns?
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
try
=COUNTIF(A1:A5,"Andy")+COUNTIF(D1:D5,"Andy")

--
Regards
Frank Kabel
Frankfurt, Germany

Molochi wrote:
Hi

I'm setting up a spreadsheet and will have two columns of text... so
for instance columns A1:A5 could contain

Andy
Bob
Chris
Dave
Eddie

while columns D1:D5 could contain
Andy
Bill
Colin
Dave
Eric

What I want to do is find a way of doing a count of the number of
occurrences a name appears across BOTH columns. I can do it down a
single column with a Pivotable, but is there an easy way to do it
down multiple columns?



  #3   Report Post  
Molochi
 
Posts: n/a
Default

Hiya Frank

The concept is good, very good in fact - the only problem is that the two
columns might run to hundreds of entries so I could do with some automatic
way of identifying the contents and then counting them.

I guess I could copy and past the two columns into a hidden third column and
Pivotable it, but I'm sure there must be an easier way?

"Frank Kabel" wrote:

Hi
try
=COUNTIF(A1:A5,"Andy")+COUNTIF(D1:D5,"Andy")

--
Regards
Frank Kabel
Frankfurt, Germany

Molochi wrote:
Hi

I'm setting up a spreadsheet and will have two columns of text... so
for instance columns A1:A5 could contain

Andy
Bob
Chris
Dave
Eddie

while columns D1:D5 could contain
Andy
Bill
Colin
Dave
Eric

What I want to do is find a way of doing a count of the number of
occurrences a name appears across BOTH columns. I can do it down a
single column with a Pivotable, but is there an easy way to do it
down multiple columns?




  #4   Report Post  
Jim May
 
Posts: n/a
Default

another view:
In Cell H1 enter =COUNTIF($D$1:$D$5,A1) and copy down to H5, then sum Col
H.
HTH
Jmay


"Frank Kabel" wrote in message
...
Hi
try
=COUNTIF(A1:A5,"Andy")+COUNTIF(D1:D5,"Andy")

--
Regards
Frank Kabel
Frankfurt, Germany

Molochi wrote:
Hi

I'm setting up a spreadsheet and will have two columns of text... so
for instance columns A1:A5 could contain

Andy
Bob
Chris
Dave
Eddie

while columns D1:D5 could contain
Andy
Bill
Colin
Dave
Eric

What I want to do is find a way of doing a count of the number of
occurrences a name appears across BOTH columns. I can do it down a
single column with a Pivotable, but is there an easy way to do it
down multiple columns?





  #5   Report Post  
Molochi
 
Posts: n/a
Default

Thanks Jim.

I think it's slightly clumsy, but using your way of doing it I've come up
with a solution:

=COUNTIF($A$1:$C$10,A1)

So long as column B doesn't contain any of the data I'm trying to count in
columns A or C I think I should be okay.

If anyone can come up with a more efficient way of doing it though, I'd
really appreciate it!


  #6   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
then use:
=COUNTIF(A:A,"Andy")+COUNTIF(D:D,"Andy")

--
Regards
Frank Kabel
Frankfurt, Germany

Molochi wrote:
Hiya Frank

The concept is good, very good in fact - the only problem is that the
two columns might run to hundreds of entries so I could do with some
automatic way of identifying the contents and then counting them.

I guess I could copy and past the two columns into a hidden third
column and Pivotable it, but I'm sure there must be an easier way?

"Frank Kabel" wrote:

Hi
try
=COUNTIF(A1:A5,"Andy")+COUNTIF(D1:D5,"Andy")

--
Regards
Frank Kabel
Frankfurt, Germany

Molochi wrote:
Hi

I'm setting up a spreadsheet and will have two columns of text... so
for instance columns A1:A5 could contain

Andy
Bob
Chris
Dave
Eddie

while columns D1:D5 could contain
Andy
Bill
Colin
Dave
Eric

What I want to do is find a way of doing a count of the number of
occurrences a name appears across BOTH columns. I can do it down a
single column with a Pivotable, but is there an easy way to do it
down multiple columns?



  #7   Report Post  
Wazooli
 
Posts: n/a
Default

Why can't you just use sumproduct...
=sumproduct(--(a1:a10=d1:d10))

Wazooli

"Molochi" wrote:

Hi

I'm setting up a spreadsheet and will have two columns of text... so for
instance columns A1:A5 could contain

Andy
Bob
Chris
Dave
Eddie

while columns D1:D5 could contain
Andy
Bill
Colin
Dave
Eric

What I want to do is find a way of doing a count of the number of
occurrences a name appears across BOTH columns. I can do it down a single
column with a Pivotable, but is there an easy way to do it down multiple
columns?

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
How do I select a range if one cells contents is equal to another KHarrison Excel Discussion (Misc queries) 2 December 20th 04 09:35 PM
Pivot Table Creating New Columns that Subtract Two Existing Columns den4673 Excel Discussion (Misc queries) 3 December 17th 04 01:31 PM
interchange columns with rows Herman Excel Discussion (Misc queries) 2 December 8th 04 05:40 PM
How can I find the common names in two columns of names? hako Excel Discussion (Misc queries) 2 December 8th 04 01:59 AM
How do I merge the contents of two columns? adamnabors Excel Discussion (Misc queries) 1 December 2nd 04 11:35 PM


All times are GMT +1. The time now is 12:19 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"