Celeb Glow
updates | March 06, 2026

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

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy