#VALUE! Error of SUMPRODUCT if cell value is ""

nuficek

Board Regular
Joined
Jul 20, 2016
Messages
54
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table calculating times based on several criteria. I have a problem with calculation if one of the cells in the criteria range (B2:B1000) is "" then I get #VALUE! Error. The following is sample table (real table has more than 1000 rows) and in this case B7 is empty cell value:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]=SUMPRODUCT(--(YEAR(A2:A1000)=B1),(B2:B1000))<strike></strike>[/TD]
[TD]2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]=IF(D2="","",D2)[/TD]
[TD]3:15[/TD]
[TD][/TD]
[TD]5.6.2017[/TD]
[/TR]
[TR]
[TD]
=IF(D3="","",D3)
<strike></strike>[/TD]
[TD]1:12[/TD]
[TD][/TD]
[TD]15.9.2017[/TD]
[/TR]
[TR]
[TD]
=IF(D4="","",D4)
<strike></strike>[/TD]
[TD]2:14[/TD]
[TD][/TD]
[TD]6.1.2018[/TD]
[/TR]
[TR]
[TD]
=IF(D5="","",D5)
<strike></strike>[/TD]
[TD]0:55[/TD]
[TD][/TD]
[TD]15.2.2018[/TD]
[/TR]
[TR]
[TD]
=IF(D6="","",D6)
<strike></strike>[/TD]
[TD]4:06[/TD]
[TD][/TD]
[TD]20.4.2018[/TD]
[/TR]
[TR]
[TD]
=IF(D7="","",D7)
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
=IF(D8="","",D8)
<strike></strike>[/TD]
[TD]2:16[/TD]
[TD][/TD]
[TD]28.7.2018[/TD]
[/TR]
[TR]
[TD]
=IF(D9="","",D9)
<strike></strike>[/TD]
[TD]1:20[/TD]
[TD][/TD]
[TD]30.10.2018[/TD]
[/TR]
[TR]
[TD]
=IF(D10="","",D10)
<strike></strike>[/TD]
[TD]3:15[/TD]
[TD][/TD]
[TD]3.2.2019[/TD]
[/TR]
</tbody>[/TABLE]
.
.
.
etc.

I tried a couple of solution but I can't get it working without error. I tried to use
<>"" or LEN function but still receiving the error. I would appreciate any help or suggestion.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
how about
=SUMPRODUCT(--(YEAR(D2:D10)=B1),(B2:B10))
 
Upvote 0
Thanks a lot for your reply, it will definetlly work. But I need to work with data as the table is much more complex. So I was trying to find out the solution wich would help me a lot. If there won't be a soultion I will use some hidden cells using your solution.
 
Upvote 0
It's impossible to tell if there is another solution, without seeing an accurate representation of your data.
From what you posted, col A is redundant as it's only showing what already exists in col D.
 
Upvote 0
I could use your solution but the first part of the table (500 entries) was using direct entry. And then there was temporary table used for import data using column D. That's also one reason why it's complicated to use your solution. Only chance would be to copy all old entries to this temporary one used for import and then it will work. And it seems to be now the easiest solution. Fluff, I can PM you the table if you want.
 
Upvote 0
As this is a public board, you will need to post the table to the thread, or upload to a share site & post the link here.
That way other members can offer assistance, should they so wish.
 
Upvote 0
Unfortunately I can't provide the entire table as it's data sensitive and it's too complex to simplify it and keep full functionality. But you are right that the data in
column A is redundant. I know that the problem is that SUMPRODUCT can't work with text but I can't sort it out.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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