Sumproduct question

mahmed1

Well-known Member
Joined
Mar 28, 2009
Messages
2,302
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Guys

I have some formula in a1:a7 =IF(H1="","",H1)
and in b1:b7, i have the count of each week

say i have

12 weeks = 2
4 Weeks = 1
8 Weeks = 3
2 Weeks = 2
Blank cell = Blank cell
Blank Cell = Blank cell
Blank Cell = Blank cell

What i want to do is have a formula that will count every thing that is >=8 Weeks
>=3 BUT LESS THAN 8 ETC....

This the formula i have but get a value error which is the part i need to get around (for the left function) (The Blank cells)

=SUMPRODUCT(--($A$1:$A$7<>""),--(LEFT($A$1:$A$7,2)+0>8),$B$1:$B$7)

This is what i get broken down

{1;1;1;1;0;0;0}, {1;0;1;0;#VALUE!;#VALUE!;#VALUE!}, {2;1;3;2;0;0;0}

Its just the value error that i need to get around
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi there,

Why not just a SUMIF() function?

Code:
=SUMIF(B1:B7,">8")

Edit: And your formula probably fails because even though you're trying to parse out the numbers from a text string, it still see's them as text and you'd need to coerce it to a numeric.
 
Upvote 0
Hi there,

Why not just a SUMIF() function?

Code:
=SUMIF(B1:B7,">8")

Edit: And your formula probably fails because even though you're trying to parse out the numbers from a text string, it still see's them as text and you'd need to coerce it to a numeric.


Hi

The reason why i am not using sumif is because in cell B1:B7, I have the count for each based on collumns a1:a7

I dont need to see how many are >=8 in column B as this the count.

The count is already done for each week

i.e

12 Weeks = 2
4 weeks = 1
8 weeks = 3
2 Weeks = 2
Blank Cell = Blank Cell
Blank Cell = Blank Cell
Blank Cell = Blank Cell

So altogether i have 5 that are >=8

The problem i have is that when i convert the left function into numerics based on +0 i get value errors for all blank cells?

=SUMPRODUCT(--($A$1:$A$7<>""),--(LEFT($A$1:$A$7,2)+0>=8),$B$1:$B$7)
 
Upvote 0
Try;

=SUM(IF(ISNUMBER(LEFT(A1:A7,2)+0),IF(LEFT(A1:A7,2)+0>=8,B1:B7)))

Conformed with CTRL+SHIFT+ENTER, not just ENTER.
 
Upvote 0
Perhaps try this version

=SUMPRODUCT(--((0&LEFT(A1:A7,2))+0>=8),B1:B7)

That will only cope with up to 2 digits with the weeks, though......
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,761
Members
452,940
Latest member
rootytrip

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