If Formula

Faiek

New Member
Joined
May 2, 2011
Messages
48
Hi,
I have 5 cells each horizontally to each other, I would like a formula so that if one of the 5 cells is 1 the others become zero. Can anyone please advise on how to do this.

Thanks
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Not exactly clear on the question. So assume you are using columns A to E.

For A1,

Code:
=IF(OR(B1=1,C1=1,D1=1,E1=1),0,A1)

For B1,

Code:
=IF(OR(A1=1,C1=1,D1=1,E1=1),0,B1)

For C1,

Code:
=IF(OR(A1=1,B1=1,D1=1,E1=1),0,C1)

For D1,

Code:
=IF(OR(A1=1,B1=1,C1=1,E1=1),0,D1)

For E1,

Code:
=IF(OR(A1=1,B1=1,C1=1,D1=1),0,E1)
 
Upvote 0
Formulas can't change the values in other cells, but VBA can.
Are the value changing by formula or direct entry into the cell?
 
Upvote 0
jdmc45:
All those formulas create a circular reference, and you can't have a value and a formula in the cell at the same time.
 
Upvote 0
Ok. Is it possible to just have these formulas in seperate cells? then it would work
 
Upvote 0
Thanks for your replies. I think Hotpepper is correct these all create a circular refrence, do any of you know the appropriate vba code?
 
Upvote 0
You could just use those formulas in the adjacent cells, such as columns F-J
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

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