Using Format Codes in Formulas

excel_slave

New Member
Joined
Mar 25, 2010
Messages
11
I am joining 2 text strings together using a formula like this:

="text "&A1&" "&A2

However, I would like the result of this formula to show the text that is in A1 not bolded and the text that is in A2 bolded. Is there a way to use format codes within the formula to accomplish this?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Sorry, a formula can only return a value. It cannot apply formatting.
 
Upvote 0
I am joining 2 text strings together using a formula like this:

="text "&A1&" "&A2

However, I would like the result of this formula to show the text that is in A1 not bolded and the text that is in A2 bolded. Is there a way to use format codes within the formula to accomplish this?
That's not possible using worksheet formulas. Worksheet formulas can only return a value, not formatting.
 
Upvote 0
That is not completely accurate. It might not be possible to format bold like I want to but if I have:

"You owe me " in cell A1
20 in cell A2

and type this formula in A3:
=A1&TEXT(A2,"$#,##0.00_)")

The result will be: You owe me $20.00
it doesnt matter how cell A2 is formatted

I didnt know if there was a similar format code/mask to use if you want to make it bold.

Thanks
 
Upvote 0
That is not completely accurate. It might not be possible to format bold like I want to but if I have:

"You owe me " in cell A1
20 in cell A2

and type this formula in A3:
=A1&TEXT(A2,"$#,##0.00_)")

The result will be: You owe me $20.00
it doesnt matter how cell A2 is formatted

I didnt know if there was a similar format code/mask to use if you want to make it bold.

Thanks
That formula did not return a format. It returned a value where the form of the value was manipulated through the TEXT function.

You can not return a format with a formula.
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

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