Grahamfff   10 #1 Posted June 17, 2022 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 Share this content via...
fools   447 #2 Posted June 17, 2022 (edited) If you mean 33.3%  ="The value "& INT(1000*A1/A2)/10 & " % is the result" Edited June 17, 2022 by fools 1 Share this post Link to post Share on other sites Share this content via...
Grahamfff   10 #3 Posted June 17, 2022 Yes 33.3%!!  Thanks very much!   Share this post Link to post Share on other sites Share this content via...
HallamGirl   43 #4 Posted June 17, 2022 (edited) 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 June 17, 2022 by HallamGirl For completeness Share this post Link to post Share on other sites Share this content via...
Grahamfff   10 #5 Posted June 23, 2022 Thank you Hallagirl - this is really useful Share this post Link to post Share on other sites Share this content via...