Keep Text color format from data to pivot table?

lbrosten

New Member
Joined
Dec 16, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have an excel worksheet where text data in some cells are changed to "red". I want that data to stay formatted "red" in any pivot tables created from that worksheet. Is this possible?

Example: Column "Hospital" has 25 entries. "General Hospital" font color is "Red". All other cells are black text. I create a pivot table and want "General Hospital" to always show in red text.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You can use Conditional formatting to make values in cell have whatever format you want. As such I was going to suggest using Array formulas rather than a Pivot Table, however Conditional Formatting does not recognize Array notation (#) (YET?), so if you still go the Conditional Formatting route, you need to make the area that the condition applies to as large as you anticipate needing for the data.
For example
Book1
A
11
22
33
44
55
Sheet1
Cell Formulas
RangeFormula
A1:A5A1=SEQUENCE(5)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A5Expression=ISODD(ROW())textNO

That works fine if the sequence is 5 or less, but if the sequence goes to 7 as it, it will fail. But if I don't expect it to grow past 40, then this would work:
Book1
A
11
22
33
44
55
Sheet1
Cell Formulas
RangeFormula
A1:A5A1=SEQUENCE(5)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A40Expression=ISODD(ROW())textNO

Expanding the Conditional Formatting range to A40 means that all odd rows will have bold red text. You can use something more restricting as the formula so that a cell's format is changed only as needed. This was just an easy demo. It's all in the formula and range, even for a Pivot Table.
OK?
 
Upvote 0
Thank you. In my scenerio, the hospital text field will be manually changed to red. There is no specific condition that could be applied.
Is this possilbe.to carry over the formating to the pivot...."If the data text in column A is red, then the make the text in the pivot table for this data point red.
Any chance that is possilble?

1671297268581.png
 
Upvote 0
Uggg! Unfortunately the formula =CELL("color",A1) returns a 0 whether the Font or Fill has a color. I don't think it's supposed to, and I've asked MS about it.
Without that, (believe it or not) some kind of VBA would be needed, but not something I'm comfortable with.
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top