Having problem with Sumproduct formula

Jongnj87

New Member
Joined
Oct 16, 2020
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Hello and good day everyone,

I have a table below for my sales return.

Everything was find until I used the Sumproduct formula on the O2. The formula I used was =SUMPRODUCT((B3:B31=N3)*H3:H31)

I realized that the range from 19 to 31 if nothing it will come out #VALUE!. However, if I range it down from 2 to 18, the formula worked!

I need help in the range if empty it will still calculate for me.


ABCDEFGHIJKLNO
1S/NoCustomer NameCodeItems PurchaseQTYRETAIL PRICE/PIECEDISCOUNTTotal CostPaymentDeliveryInvoiceRemarksSELECTED CUSTOMER NAMEACCUMULATED PURCHASE
21Rui XianBX68黑碧玺柱1$68.00
$68.00​
Rui Xian
#VALUE!​
32Ken TanHK8凯蒂猫吊坠3$8.00
$24.00​
43Seah Yuh LihZC20招财猫(金泰)1$20.00
$20.00​
54Rui XianMM8米老鼠(粉虎眼)1$8.00
$8.00​
65HX QiuSY8四叶草1$8.00
$8.00​
76Casey LimHL10海蓝宝(平安扣)1$10.00
$10.00​
87丽彬HL8黄水晶葫芦1$8.00
$8.00​
98Casey LimCQT20超七桶1$20.00
$20.00​
109Ping PongCQT20超七桶1$20.00
$20.00​
1110Ping PongMP68玛瑙聚宝盆1$68.00
$68.00​
1211Christine ChenBXX20碧玺牌 - 星星1$20.00
$20.00​
1312Casey LimBXA20碧玺牌 - 爱心1$20.00
$20.00​
1413Christine ChenHKB8黑曜石 - 凯蒂猫2$8.00
$16.00​
1514Christine ChenZJX20紫晶 - 星星1$20.00
$20.00​
1615Jasmine TayBXY20碧玺牌 - 圆1$20.00
$20.00​
1716Fiona LeeSY8四叶草1$8.00
$8.00​
1817Fiona LeeZZ10珍珠1$10.00
$10.00​
1918
2019
2120
2221
2322
2423
2524
2625
2726
2827
2928
3029
3130
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
12,609
Office Version
  1. 365
Platform
  1. Windows
If the blanks in column H contain formulas that return a blank then it will cause that error, in those cases you need to use
Excel Formula:
=SUMPRODUCT(--(B3:B31=N3),H3:H31)
or simpler,
Excel Formula:
=SUMIFS(H3:H31,B3:B31,N3)
Don't forget to make the ranges absolute if you're dragging the formula down the sheet.
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,526
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=SUMPRODUCT(--(B3:B31=N3),H3:H31)
 

Jongnj87

New Member
Joined
Oct 16, 2020
Messages
27
Office Version
  1. 365
Platform
  1. Windows
If the blanks in column H contain formulas that return a blank then it will cause that error, in those cases you need to use
Excel Formula:
=SUMPRODUCT(--(B3:B31=N3),H3:H31)
or simpler,
Excel Formula:
=SUMIFS(H3:H31,B3:B31,N3)
Don't forget to make the ranges absolute if you're dragging the formula down the sheet.

It solved my problem. Thank You
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,526
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,475
Messages
5,636,543
Members
416,923
Latest member
jarri

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
Top