ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need to count occurances in different columns (https://www.excelbanter.com/excel-worksheet-functions/123436-need-count-occurances-different-columns.html)

More Macro Help Needed

Need to count occurances in different columns
 
I have columns of data (each with a different column name at the top: Jan,
Feb, Mar, etc). The columns consist of three or more different words (apple,
pear, orange, etc.) and zero values. I am looking for a formula that will
count the occurance of the words in each column based on two criteria: Column
Name and Word. For example: If I set cell A1 to Jan and cell B1 to Apple,
cell C1 returns all the times Apple appears in the Jan column. The number of
columns is different from the number of rows in each column. Any help with
this is greatly appreciated. Let me know if more information is needed.
Thanks.

Dan

Bob Phillips

Need to count occurances in different columns
 
Assuming the months in D1:M1

=SUMPRODUCT(--(OFFSET(D1,,MATCH(A1,D1:M1,0)-1,100,1)=B1))

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"More Macro Help Needed"
wrote in message ...
I have columns of data (each with a different column name at the top: Jan,
Feb, Mar, etc). The columns consist of three or more different words
(apple,
pear, orange, etc.) and zero values. I am looking for a formula that will
count the occurance of the words in each column based on two criteria:
Column
Name and Word. For example: If I set cell A1 to Jan and cell B1 to
Apple,
cell C1 returns all the times Apple appears in the Jan column. The number
of
columns is different from the number of rows in each column. Any help
with
this is greatly appreciated. Let me know if more information is needed.
Thanks.

Dan




More Macro Help Needed

Need to count occurances in different columns
 
Worked great!!! Thanks so much..

"Bob Phillips" wrote:

Assuming the months in D1:M1

=SUMPRODUCT(--(OFFSET(D1,,MATCH(A1,D1:M1,0)-1,100,1)=B1))

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"More Macro Help Needed"
wrote in message ...
I have columns of data (each with a different column name at the top: Jan,
Feb, Mar, etc). The columns consist of three or more different words
(apple,
pear, orange, etc.) and zero values. I am looking for a formula that will
count the occurance of the words in each column based on two criteria:
Column
Name and Word. For example: If I set cell A1 to Jan and cell B1 to
Apple,
cell C1 returns all the times Apple appears in the Jan column. The number
of
columns is different from the number of rows in each column. Any help
with
this is greatly appreciated. Let me know if more information is needed.
Thanks.

Dan






All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com