Avoiding a DIV/0 Error in a 3 range SUMPRODUCT

captainxcel

New Member
Joined
Jul 28, 2017
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,
Trying to avoid a div/0 on a sumproduct that contains 3 ranges. The range doe_target below occasionally contains zero values.

=SUMPRODUCT((doe_actual/doe_target),growth_weights)

Thanks!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
You could use a simple array formula to get your desired result...
{=sum(IF(doe_target=0,0,doe_actual/doe_target*growth_weights))}

Note: this formula must be committed by using CTRL+SHIFT+ENTER you will see the curly braces around the formula if committed correctly.

Good luck,

CN.
 
Upvote 0
Hello,

it will be useful to know what you want as an answer instead of div/0, i will write this formula as if you want to have "problem" as result.

=IFERROR(SUMPRODUCT((doe_actual/doe_target),growth_weights),"problem")
 
Last edited:
Upvote 0
Thank you both. The array formula solved the issue, but I will also play around with the latter. What I was trying to accomplish was calculating the percentage invested a portfolio was while allowing for the portfolio to change such that the target for a particular security could be at zero as with "IBB" below.

TickerFund NameGrowthIncome
IVViShares S&P 500 Index Fund80%50%
BSVVanguard Short-Term Bond ETF0%10%
IBBiShares Nasdaq Biotechnology Index0%0%
BNDVanguard Total Bond Market10%20%
VNQVanguard REIT ETF10%20%
100%100%

<colgroup><col width="91" style="width:68pt"> <col width="179" style="width:134pt"> <col width="64" style="width:48pt" span="2"> </colgroup><tbody>
</tbody>
 
Upvote 0
Or if the Div/0 element is to contribute 0 to the sum then....

=SUMPRODUCT(IFERROR((doe_actual/doe_target),0),growth_weights)

And confirm with Ctrl + Shift + Enter

Hope that helps.
 
Upvote 0
Thanks Tony. The first suggestion from CodeNinja produced the results in blue, which I think work for me. I am trying to get a sense of the percent invested a client is. In the below paste, all yellow cells are input cells. In this particular case, for client 'Jane Doe' we have taken the target weight to IBB to zero and upped the target weight to IVV. The client is in the process of selling down IBB taking it's weight to "0" and purchasing IVV. Additionally, the client has yet to purchase any BND.

Jane Doe
Portfolio Size:$150,000 TargetActual %Actual $
Growth80%$120,00081%$96,757
Income20%$30,00074%$22,243
100%$150,00079%$119,000
TickerTarget %Target $Actual
IVV74%$111,000 $98,000
BSV2%$3,000 $3,000
IBB0%$0 $5,000
BND12%$18,000 $0
VNQ12%$18,000 $18,000
CASH$26,000
TOTAL:100%$150,000 $150,000
target $=actual $:OK

<colgroup><col width="256" style="width:192pt"> <col width="68" style="width:51pt"> <col width="102" style="width:77pt"> <col width="68" style="width:51pt" span="2"> </colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,873
Members
449,056
Latest member
ruhulaminappu

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