View Single Post
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On 27 Jun 2005 12:36:59 -0700, "Tyson" wrote:

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.0 0"))

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


--ron