Ali Raza Arain
Ali Raza Arain

Reputation: 17

Excel Formula for different font color in one cell

Can you provide a formula to display a single cell value as text with multiple colors in Excel, where half of the text is red and the remaining text is blue, as the value is given in a single cell and needs to be displayed in two colors within the same cell.enter image description here

Formula:

="ERRORS ("& COUNTIF(D17:D,"=Fail") &") & WARNINGS ("& COUNTIF(D17:D,"=Pass") &")"

Output

ERRORS (5) & WARNINGS (5) enter image description here

Upvotes: 1

Views: 156

Answers (1)

doubleunary
doubleunary

Reputation: 18809

The "multiple colors" concept you describe is called rich text. In Google Sheets, rich text cannot be produced with any spreadsheet formula. To programmatically put rich text in in a cell, you need a script. See RichTextValueBuilder.

Upvotes: 2

Related Questions