Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to specify the formatting in an excel formula?

=IF(A1="Large","This is BIG","This is small")

Where "BIG" is of a font size larger than the text for "small"?

(I'm aware of conditional formatting. That's not what I'm after.)

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can make a UDF in VBA that will return the font size

Function FontSize(rCell As Range) As Long
    Application.Volatile
    FontSize = rCell.Font.Size
End Function

But it won't update just because you change the font size - that is changing the font size doesn't cause Excel to recalculate. You could, again using VBA, try to capture all the buttons that change the font size and force a recalc when the user presses them, but...

I think my answer is: there's really no good way to do this.

share|improve this answer

Are you trying to check font size only? This could be impossible I would say.

You could set multiple sizes for font in single cell, so it would be hard to make function that will work well on that.

For checking other infos about single cell there is a CELL function

=CELL("info_type",[reference])

share|improve this answer
    
I'm not checking, just trying to set different font values within the equation. I guess calculations only output standard text –  jay May 18 '10 at 7:04
    
I've never heard of anything like formatting result of formula. The only options could be VBA then if you don't want to use Conditional Formatting. –  Cornelius May 20 '10 at 5:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.