ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formatting within formulas (https://www.excelbanter.com/excel-discussion-misc-queries/139590-formatting-within-formulas.html)

cjbrooks

Formatting within formulas
 
I would like to make certain text within a cell bold. This is normally
straight forward when everything in a cell is text, the trouble lies when the
text to be displayed is dependent on formula.
For example, if A1="Mr" and B1="Smith". I can make cell B2 refer to cells A1
and B1 to display "How is Mr Smith today?", with the following code:
B2= "How is " & A1 & " " & B1 & " today?"
However, I'd like to be able to display only the text "Mr Smith" in bold. Is
there a simple way to amend the formula above to make this happen?

Dave Peterson

Formatting within formulas
 
Cells with formulas can't be formatted this way.

cjbrooks wrote:

I would like to make certain text within a cell bold. This is normally
straight forward when everything in a cell is text, the trouble lies when the
text to be displayed is dependent on formula.
For example, if A1="Mr" and B1="Smith". I can make cell B2 refer to cells A1
and B1 to display "How is Mr Smith today?", with the following code:
B2= "How is " & A1 & " " & B1 & " today?"
However, I'd like to be able to display only the text "Mr Smith" in bold. Is
there a simple way to amend the formula above to make this happen?


--

Dave Peterson

cjbrooks

Formatting within formulas
 
can anyone suggest a way to get the result i'm after?

"Dave Peterson" wrote:

Cells with formulas can't be formatted this way.

cjbrooks wrote:

I would like to make certain text within a cell bold. This is normally
straight forward when everything in a cell is text, the trouble lies when the
text to be displayed is dependent on formula.
For example, if A1="Mr" and B1="Smith". I can make cell B2 refer to cells A1
and B1 to display "How is Mr Smith today?", with the following code:
B2= "How is " & A1 & " " & B1 & " today?"
However, I'd like to be able to display only the text "Mr Smith" in bold. Is
there a simple way to amend the formula above to make this happen?


--

Dave Peterson


Pete_UK

Formatting within formulas
 
Without resorting to VBA, you could achieve this by putting the
following in the cells spedified:

B2: "How is "
C2: =A1&" "&B1
D2: " today?"

Strictly speaking, you don't need the quotes in B2 and D2, but I've
included them to show that you need the spaces (or you could put them
in the formula in C2). Then set C2 to bold and adjust the column
widths so that B2:D2 looks like a continuous text string.

Hope this helps.

Pete

On Apr 20, 10:48 am, cjbrooks
wrote:
can anyone suggest a way to get the result i'm after?



"Dave Peterson" wrote:
Cells with formulas can't be formatted this way.


cjbrooks wrote:


I would like to make certain text within a cell bold. This is normally
straight forward when everything in a cell is text, the trouble lies when the
text to be displayed is dependent on formula.
For example, if A1="Mr" and B1="Smith". I can make cell B2 refer to cells A1
and B1 to display "How is Mr Smith today?", with the following code:
B2= "How is " & A1 & " " & B1 & " today?"
However, I'd like to be able to display only the text "Mr Smith" in bold. Is
there a simple way to amend the formula above to make this happen?


--


Dave Peterson- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 01:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com