Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
=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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why does my excel have numbered columns and rows | Excel Discussion (Misc queries) | |||
How to get pivot table data columns instead of rows | Excel Discussion (Misc queries) | |||
Can I rotate excel sheets so columns are rows & vice-versa (i.e.. | Excel Discussion (Misc queries) | |||
Convert multiple columns to rows | Excel Worksheet Functions | |||
Select all data, multiple rows | Excel Discussion (Misc queries) |