Jump to content

Question About Formatting Expressions In Excel

Recommended Posts

I have a spreadsheet in which cell A1 has the value 3 and A2 has the value 9.

 

I want another cell to look like this:

 

The value 3.3% is the result

 

If I type into the cell: ="The value "& A2/A3 & "is the result"

 

This displays as:

 

The value 3.33333333 is the result

 

Is it possible to have a formatted value within the expression? 

 

Thanks

Share this post


Link to post
Share on other sites

If you mean 33.3%

 

="The value "& INT(1000*A1/A2)/10 & " % is the result"

Edited by fools
  • Like 1

Share this post


Link to post
Share on other sites

Yes 33.3%!!

 

Thanks very much!

 

 

Share this post


Link to post
Share on other sites

You can use the TEXT function in a formula to display the results in a specific format.

For example ="The value is " & TEXT(33.3333333,"0.##") would display as : 
The value is 33.33

 

Google the VBA help on the TEXT function format codes for a complete list, but 0 always displays a digit in the mask, whereas # displays an optional digit if there is one (so 33.3 would display just as 33.3, not 33.30 in this example). You can create complex formats for positive, negative, zero and null values separated by a semicolon, you can even display negatives in red using the [Red] format, or with brackets, which are often used in accountancy etc. Obviously in your case you would replace the numeric 33.33333 with your formula, A1/A2 or whatever it was.

Edited by HallamGirl
For completeness

Share this post


Link to post
Share on other sites

Thank you Hallagirl - this is really useful

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.