Conditional formatting question

GeorgeCunn

New Member
Joined
Jun 21, 2017
Messages
10
If I enter a "Y" in B7, I want it to automatically enter a 0 in B9 using conditional formatting.

I tried using this formula (in conditional formatting) but it didn't work.

=if(B7="Y",0,"") I also tried if(B7="Y",0,0) Unfortunately neither worked.

As an option, if a "Y" was entered in B7, then it would automatically delete the contents in B9.

Thanking you in advance for your help.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
You need to enter a formula in the cell, not conditional formatting.
 
Upvote 0
To elaborate a bit more, you not change (or delete) what is in a cell with conditional formatting, you can only alter the appearance of the existing contents.

If B9 has a numeric value then you could hide it with conditional formatting, but the original value would still be there in the background, the actual value would not be changed. You would notice this if you have other formulas looking at B9.
 
Upvote 0
Thank you very much. That is what I thought but I also thought it never hurts to ask in case there is a work around.
 
Upvote 0
The only workaround would be to delete the content of B9 using vba when B7 is changed to 'Yes'. The downside of this is that it would not 'undo' if you enter 'yes' in error.

I'm assuming that there are values in B9 which should be disregarded when 'Yes' is entered, is that correct? If so, then a conditional format formula of

=B7="yes"

Combined with a custom number format as below (this needs to be set in Conditional Formatting > Format > Number, not on the Home tab).

\0;\0;0;@

Will mask any non zero numbers as zero. Note that any formulas that refer to B9 will still see the original value, not the zero. If you have any such formulas then you will need to apply a condition to them as well.
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,921
Members
449,094
Latest member
teemeren

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