ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calculations (https://www.excelbanter.com/excel-worksheet-functions/84381-calculations.html)

J. McGonigal

Calculations
 
I am attempting to create a function to do the following.

I have to columns of data that I need to go through. I am attempting to
talley the number of occurences of each item.

To do this I need to go through column 'a' and every time it is 1, i then
must check column 'b'. If in column b the numbers 1,3,5,6 are found then I
need to add one to the talley. Can anyone suggest a way to do this. I
attempted to use countif formula but could not get something on it to work.



Biff

Calculations
 
Hi!

Try this:

=SUMPRODUCT(--(A1:A20=1),--(ISNUMBER(MATCH(B1:B20,{1,3,5,6},0))))

Biff

"J. McGonigal" wrote in message
...
I am attempting to create a function to do the following.

I have to columns of data that I need to go through. I am attempting to
talley the number of occurences of each item.

To do this I need to go through column 'a' and every time it is 1, i then
must check column 'b'. If in column b the numbers 1,3,5,6 are found then I
need to add one to the talley. Can anyone suggest a way to do this. I
attempted to use countif formula but could not get something on it to
work.





Fred Smith

Calculations
 
The other option is to create a Pivot Table. Once you understand them, they are
very slick and very powerful. There are several sites, including
www.cpearson.com which explain Pivot Tables.

--
Regards,
Fred


"J. McGonigal" wrote in message
...
I am attempting to create a function to do the following.

I have to columns of data that I need to go through. I am attempting to
talley the number of occurences of each item.

To do this I need to go through column 'a' and every time it is 1, i then
must check column 'b'. If in column b the numbers 1,3,5,6 are found then I
need to add one to the talley. Can anyone suggest a way to do this. I
attempted to use countif formula but could not get something on it to work.





J. McGonigal

Calculations
 
Thanks, this worked wonderfully! Would mine explaining what the "--" do?

"Biff" wrote:

Hi!

Try this:

=SUMPRODUCT(--(A1:A20=1),--(ISNUMBER(MATCH(B1:B20,{1,3,5,6},0))))

Biff

"J. McGonigal" wrote in message
...
I am attempting to create a function to do the following.

I have to columns of data that I need to go through. I am attempting to
talley the number of occurences of each item.

To do this I need to go through column 'a' and every time it is 1, i then
must check column 'b'. If in column b the numbers 1,3,5,6 are found then I
need to add one to the talley. Can anyone suggest a way to do this. I
attempted to use countif formula but could not get something on it to
work.






J. McGonigal

Calculations
 
Thanks, I will begin to look at this in the near future.

"Fred Smith" wrote:

The other option is to create a Pivot Table. Once you understand them, they are
very slick and very powerful. There are several sites, including
www.cpearson.com which explain Pivot Tables.

--
Regards,
Fred


"J. McGonigal" wrote in message
...
I am attempting to create a function to do the following.

I have to columns of data that I need to go through. I am attempting to
talley the number of occurences of each item.

To do this I need to go through column 'a' and every time it is 1, i then
must check column 'b'. If in column b the numbers 1,3,5,6 are found then I
need to add one to the talley. Can anyone suggest a way to do this. I
attempted to use countif formula but could not get something on it to work.







All times are GMT +1. The time now is 11:38 AM.

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