Conditionally centering text in an Excel formula
Is there a way to tell Excel to center the text and keep a numeric value right aligned. For example in the formula =IF(+A1=+A2,"Match",+A1-A2), I would like Excel to center the word "Match" but right align if there is a numeric value. I think I used to use the ^ character to center text in Excel but that doesn't appear to work anymore.
1 Answer
You can't set alignment with custom formatting, but you can fake it by setting the cell alignment to center and using this custom format:
* #.00; * -#.00;* 0;@It uses the repeat character, *, to force numbers to the right. It displays two decimal places, unless the value is zero.