View Single Post
  #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.