Forum Discussion
maxgolaz
Feb 11, 2020Copper Contributor
change number format in cell depending on value in another cell
Hi Using Excel for Mac 2011. I want to change the number format of a cell depending on the value of text in an adjacent cell. So for example, in cell A i have the a drop down list of options "%" ...
PReagan
Feb 11, 2020Bronze Contributor
Hello maxgolaz,
That could be done with a series of IF() and TEXT() functions. For example, to search for "%" or "M2" as a unit would be:
=IF($A1="%",TEXT($B1,"0%"),IF($A1="M2",TEXT($B1,"0"),"NO SUCH FORMAT"))
The series of IF() statements could be extended by replacing "NO SUCH FORMAT" with additional IF() statements.