How to copy the cell format while using the "IF" function.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wnat to execute an IF function which returns a value (cell content) to another cell. I like to know how If finction returns not just the cell content but also its format. e.g.
if A1=555, ( A1 is formatted so that the font is Blue)
A2=555 (A2 is formattted so that the font color is Red)
A3=1
A4 is an empty cell and formatted so that font color is Black.
in A4 if I use IF function as ...If(A3=1,A1,A2)
When the value returns I like to see 555 in blue font and not black
How can I do this...please help....Thanks
 
Hi Haren

a formula cannot change the cell format. Two possible workarounds
1. use conditional formating to achieve the formats you want based on
the cell value(e.g. for A4 enter the formula "=A3=1" in the conditional
format dialog and set the font color accordingly)

2. Use VBA and process the worksheet_change event.

HTh
Frank
 
Back
Top