Conditional divide (divide if)

eendje

Board Regular
Joined
Nov 9, 2006
Messages
54
B C D
10 1 5
8 0 6
4 1 4

This is a short version of my sheet. Column C only contains 1 or 0. Column B and D all sorts of numeric values.

For each cell in column A I want to check if the corresponding cell in column C contains a 1 and if so, I want it to divide the corresponding cell in column B with that one of column D. If the value in column C is 0, it should return 0

So in the example above, Column A would have the values 2 (10/5), 0 (since C=0) and 1 (4/4).

To be more accurate, I want to use this formula inside another formula, something like:
=1-$A2+$A2*(B4/D4+B6/D6+...+...for all where column C has value of 1)

Can anyone assist me with this please? I looked a bunch but couldn't find the solution.
 
Actually, the formula still does not exactly do what I need it to (my bad, I did not explain the whole thing, sorry).

I am using circular reference formula and have iterative calculations enabled. (allowing circular references is a must for what I want).

Therefor, to keep my cirular references intact, the formula should state that where ever the corresponding value in column C = 0, it should NOT do the dividing (cuz it could result in deviding by 0 where my whole circular reference system collapses).

Anyway to achieve this? (pardon for the bad spelling)
 
Last edited:
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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