Conditional Format for Numbers

T

Tyson

Is it possible in Excel to conditionally format a Number type in a cell
based on another cell?

Example

A1 is a dropdown with "Variance $" and "Variance %"

And in A2 I have an IF statement that that will give a result from two
other cells. What I want A2 to show is either $#.## or ##% depending
on what I have in the drop down.

Any help would be great.

Thanks

Tyson
 
R

Ron Rosenfeld

Is it possible in Excel to conditionally format a Number type in a cell
based on another cell?

Example

A1 is a dropdown with "Variance $" and "Variance %"

And in A2 I have an IF statement that that will give a result from two
other cells. What I want A2 to show is either $#.## or ##% depending
on what I have in the drop down.

Any help would be great.

Thanks

Tyson

In order to actually FORMAT the cell, you would have to either guarantee
non-overlapping values for $ vs %, which you could then test, or use a VBA
event-triggered macro.

To have it display the way you want, a simple formula can do that; but the
result is a text string and may not be useable by some functions, directly.

=IF(A1="Variance %", TEXT(your_formula,"0.00%"),TEXT(your_formula,"$0.00"))

If this is not satisfactory, post back and we'll derive a VBA solution.


--ron
 
T

Tyson

Ron said:
In order to actually FORMAT the cell, you would have to either guarantee
non-overlapping values for $ vs %, which you could then test, or use a VBA
event-triggered macro.

To have it display the way you want, a simple formula can do that; but the
result is a text string and may not be useable by some functions, directly.

=IF(A1="Variance %", TEXT(your_formula,"0.00%"),TEXT(your_formula,"$0.00"))

If this is not satisfactory, post back and we'll derive a VBA solution.


--ron


Perfect!

Thanks Ron.

Tyson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top