SUM or COUNT?

Raiiden

New Member
Joined
Jun 26, 2008
Messages
11
I am trying to add up the number of rows on sheet one that meet two different criteria, and produce the result in sheet 2.

1) Column A contains "36" - this ranges from 1 to 52

2) Colum M contains "1" - this is always 1 or 0

My code:

=COUNT(AND(COUNTIF('2008 Schedule'!$A5:$A10000,"36"),COUNTIF('2008 Schedule'!$M5:$M10000,1)))

It just seems to return "1" all the time wheteher anything is added or not.

Any ideas please?

Thanks
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I am trying to add up the number of rows on sheet one that meet two different criteria, and produce the result in sheet 2.

1) Column A contains "36" - this ranges from 1 to 52

2) Colum M contains "1" - this is always 1 or 0

My code:

=COUNT(AND(COUNTIF('2008 Schedule'!$A5:$A10000,"36"),COUNTIF('2008 Schedule'!$M5:$M10000,1)))

It just seems to return "1" all the time wheteher anything is added or not.

Any ideas please?

Thanks

Try...
Code:
=SUMPRODUCT(
    --('2008 Schedule'!$A5:$A10000=36),
    --('2008 Schedule'!$M5:$M10000=1))
 
Upvote 0
I tried that thanks but I just get a 0 with that code.

=SUMPRODUCT(('2008 Schedule'!$A5:$A10000=36),('2008 Schedule'!$M5:$M10000=1))
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,205
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top