sumproduct and sum not working

kiran5388

Board Regular
Joined
Sep 7, 2021
Messages
62
Office Version
  1. 365
Platform
  1. Windows
Table 1 result is fine, but the Table 2 is not working. Please help.
TodayCalcSample.xlsx
ABCDEFGHI
1Table 1
2productC4012
3productA1602
4productB0002
5productA002
6productB0102
7productA2002Result=16
8
9
10
11Table 2
12productA4012
13productA16002
14productB0002
15productA0002
16productB0102Result=#VALUE!
17productA24002
18productB202Expected =26
19productB4052
20productA1002
21productA0002
22productA0002
23productA0002
24productA0502
25productA7002
26productA0202
27productB3002
28productA0002
29productA12002
30productA2012
31productA2
32productA0002
33productA6002
34productA3822
35productA0002
36productA1002
37productA7002
38productA0002
39productA4002
40productA6002
41productA3002
42productA1002
43productA4012
44productA1002
45productA65002
46productA1002
47productA0042
48productA1002
49productA86002
50productA1002
51productA1002
52
Sheet4
Cell Formulas
RangeFormula
H7H7=SUMPRODUCT((E2:E7<>"")*1,(B2:B7<>"")*1,(C2:C7<>"")*1,(D2:D7<>"")*1,E2:E7,B2:B7+C2:C7+D2:D7)
H16H16=SUMPRODUCT((A12:A51="productB")*1,(B12:B28<>"")*1,(C12:C51<>"")*1,(D12:D51<>"")*1,(E12:E51<>"")*1,E12:E51,B12:B51+C12:C51+D12:D51)
 
Try to add zero value to your B12:E51 by:
Copy a blank cell (copy zero)
select B12:B51
Paste/paste special: Operation: Add

Does it work?
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try to add zero value to your B12:E51 by:
Copy a blank cell (copy zero)
select B12:B51
Paste/paste special: Operation: Add

Does it work?
Manually if I enter the values and the blank cell the formula works fine, I don't know programmatically the blanks cells are considered in different datatype maybe
 
Upvote 0
That why I suggest to "wake those blank cells up" by add a "zero" value to automaticallyas per #11.
 
Upvote 0
That why I suggest to "wake those blank cells up" by add a "zero" value to automaticallyas per #11.
I Like your suggestion, but if the blanks are made into zero, then the row which was empty now will gets into calculation and the result will be different than expected
 
Upvote 0
Try selecting the column, then click the Data tab, click Text to Columns, click Next, check that none of the options is checked and click Next, click Finish.

Does that make a difference?
 
Upvote 0
Try selecting the column, then click the Data tab, click Text to Columns, click Next, check that none of the options is checked and click Next, click Finish.

Does that make a difference?
anyways thanks, I cant do it manually, the program should handle that. I got the solution, the empty cells are being string DataTypes, I made those to null by program. that seems to be working.
 
Upvote 0
That why I suggest to "wake those blank cells up" by add a "zero" value to automaticallyas per #11.
anyways thanks, I cant do it manually, the program should handle that. I got the solution, the empty cells are being considered as string DataTypes, I made those to null by program. now I got the answer seems to be working.
 
Upvote 0
Glad you got it sorted (btw there is no reason why you couldn't record the actions that I proposed in post 15 to get the code if you wanted it done via code)
 
Upvote 0
I Like your suggestion, but if the blanks are made into zero, then the row which was empty now will gets into calculation and the result will be different than expected
Sorry, I mean copy blank cell (null value, not zero) to a null cell. Destination cell does not change.
Test by: Assum A1,B1 is blank. In A2, use: =A1="" =>="TRUE"
Copy B1, paste=Add to A1. A2 still=TRUE. It means A1 still="null".
 
Upvote 0

Forum statistics

Threads
1,223,727
Messages
6,174,148
Members
452,547
Latest member
Schilling

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