I have a conditional statement in one column that, if the value in a second column is TRUE, enters a value from a third column and enters 0 if the value in the second column is FALSE. The formula is: =IF(F6=1, B6, 0).
I’d like to format the values in column F to display 4 decimal places if they are non-zero and to display no decimal places if they are equal to 0. In other words, I’d like the outputs to be as follows:
0.9417 -> 0.9417 2 -> 2.0000 0 -> 0
Right now, I have the format code set to
0.#### but this isn’t quite what I need. The outputs I’m getting look like this:
0.9417 -> 0.9417 2 -> 2 0 -> 0
The first and third values are correct, but the second is not. Is there a way to alter the cell format code such that decimals are always displayed if the number in it is non-zero?
Thank you in advance!