Sumproduct or count problem

JV0710

Active Member
Joined
Oct 26, 2006
Messages
440
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Hi

Please can I get some help with the following query:

I have the following formula in my spreadsheet

=SUMPRODUCT(--(X7:X1000=AH8)*(W7:W1000=AH7)*ISNUMBER(N7:T1000))

I need to add another condition:
In the area that I want to count columns (N7:T1000), I only want to count in the columns where the cells in each column have more than 5 cells with numbers in the column and that satisfy the other conditions in the formula:

For example: If in column P of my area ( N7:T1000), where (X7:X1000=AH8) and (W7:W1000=AH7) there are only 3 cells with numbers, then column P must NOT be included in the count. the area to include in the count should then be (N7:07) & (Q7:T7)

I hope that makes sense

I would appreciate any help please

Thanks

Joe
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hello Joe,

Try this "array formula"

=SUM(TEXT(MMULT(TRANSPOSE((X7:X1000=AH8)*(W7:W1000=AH7)*ISNUMBER(N7:T1000)),ROW(X7:X1000)^0),"[<=5]""0"";0")+0)

confirm with CTRL+SHIFT+ENTER
 
Upvote 0
Hi Barry

Thanks for the reply . . .

I tried your formula but it still counts the cells in columns that have less than 5 cells with numbers in them.
FOR INFO --- In my Actual spreadsheet columns N and T have less than 5 cells that have numbers in them ( where conditions are met) , so they need to be excluded from the count.

Thanks

Joe
 
Upvote 0
OK, Joe, based on my understanding of what you want to do then that formula seems to work for me.

See if I understand OK.....

Let's say you have 10 rows only where the two criteria for columns W and X are satisfied....and in those same 10 rows in column N you have only 3 numbers....but in column P you have 6 numbers..then the 6 would be included in the total but the 3 wouldn't.....that's what my suggested formula does.

You could get the same answer by using a helper row, e.g. in N1 use this formula copied across to T1

=SUMPRODUCT(($X7:$X1000=$AH8)*($W7:$W1000=$AH7)*ISNUMBER(N7:N1000))

and then use a SUMIF formula on that range to get the final total

=SUMIF(N1:T1,">5")

That should give the same result as my single formula

Note that assumes that exactly 5 doesn't count - if you want exactly 5 to count then change >5 to >=5
 
Upvote 0
Hi Barry

Sorry I took so long to respond

I have worked it out with your formula

Thank you very much for your help

Regards

Joe
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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