Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sparham
 
Posts: n/a
Default Finding common data in multiple columns and rows in Excel

I'm trying to determine the number of times that certain data appears in two
columns, on the same row. For example:
Below are two columns. I want to know how many times that column G has
"apple" and column K has "pie". I'm only interested in knowing how many rows
contain both "apple" and "pie".
Column G Column K
apple pie
apple cider
orange juice
banana pudding
apple pie
banana bread
kiwi pie
apple pie
orange juice
kiwi juice
kiwi pie
orange danish
apple cider
orange juice
apple pie
orange juice
kiwi juice

Using the correct function(s), I should be able to get the answer; 4. But I
don't know what function(s) to use.
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

=SUMPRODUCT(--(G2:G100="apple"),--(K2:K100="pie"))

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



"sparham" wrote in message
...
I'm trying to determine the number of times that certain data appears in
two
columns, on the same row. For example:
Below are two columns. I want to know how many times that column G has
"apple" and column K has "pie". I'm only interested in knowing how many
rows
contain both "apple" and "pie".
Column G Column K
apple pie
apple cider
orange juice
banana pudding
apple pie
banana bread
kiwi pie
apple pie
orange juice
kiwi juice
kiwi pie
orange danish
apple cider
orange juice
apple pie
orange juice
kiwi juice

Using the correct function(s), I should be able to get the answer; 4. But
I
don't know what function(s) to use.



  #3   Report Post  
Max
 
Posts: n/a
Default

One way

Assume source data is in Sheet1, cols G and K, rows 2 to 20

In Sheet2
-------------

Assuming you have in A2: apple, in B2: pie, with other similar paired inputs
in A3:B3, A4:B4, etc

Put in C2:

=SUMPRODUCT((TRIM(Sheet1!$G$2:$G$20)=TRIM(A2))*(TR IM(Sheet1!$K$2:$K$20)=TRIM
(B2)))

Copy C2 down

Adapt the ranges to suit, but note that you can't use entire col refs (A:A,
B:B, etc) within SUMPRODUCT

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"sparham" wrote in message
...
I'm trying to determine the number of times that certain data appears in

two
columns, on the same row. For example:
Below are two columns. I want to know how many times that column G has
"apple" and column K has "pie". I'm only interested in knowing how many

rows
contain both "apple" and "pie".
Column G Column K
apple pie
apple cider
orange juice
banana pudding
apple pie
banana bread
kiwi pie
apple pie
orange juice
kiwi juice
kiwi pie
orange danish
apple cider
orange juice
apple pie
orange juice
kiwi juice

Using the correct function(s), I should be able to get the answer; 4. But

I
don't know what function(s) to use.



  #4   Report Post  
sparham
 
Posts: n/a
Default

Thank you, Peo Sjoblom! That was what I needed to know in order to get the
totals that I needed.

"Peo Sjoblom" wrote:

=SUMPRODUCT(--(G2:G100="apple"),--(K2:K100="pie"))

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



"sparham" wrote in message
...
I'm trying to determine the number of times that certain data appears in
two
columns, on the same row. For example:
Below are two columns. I want to know how many times that column G has
"apple" and column K has "pie". I'm only interested in knowing how many
rows
contain both "apple" and "pie".
Column G Column K
apple pie
apple cider
orange juice
banana pudding
apple pie
banana bread
kiwi pie
apple pie
orange juice
kiwi juice
kiwi pie
orange danish
apple cider
orange juice
apple pie
orange juice
kiwi juice

Using the correct function(s), I should be able to get the answer; 4. But
I
don't know what function(s) to use.




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
Why does my excel have numbered columns and rows DLYNN Excel Discussion (Misc queries) 1 January 22nd 05 12:20 AM
How to get pivot table data columns instead of rows Jessica Excel Discussion (Misc queries) 0 January 19th 05 04:29 PM
Can I rotate excel sheets so columns are rows & vice-versa (i.e.. JamesR Excel Discussion (Misc queries) 3 January 12th 05 02:18 PM
Convert multiple columns to rows Lois Lane Excel Worksheet Functions 8 January 10th 05 12:47 AM
Select all data, multiple rows George Wilson Excel Discussion (Misc queries) 6 December 5th 04 08:16 PM


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