Excel question - reporting a range

Petal

Registered User
Messages
881
Hiya,

Hope someone knows this.

I want to combine values from two different cells and report them as a range in another cell. So in principle I know how to do this - assuming I want values from Cells D4 and H4, I do the following:

D4&"-"&H4

However, what I do not want is the millions of decimal places after each number. D4 and H4 are set to two decimal places, but using the above formula I end up with something like this

3.123456789 - 5.456789123

and I really only want 3.1 - 5.5

Is there a way of doing this?
 
Ah, just found the solution myself....

So for anyone who might ever encounter this problem, the thing to do is

ROUND(D4,2)&"-"&ROUND(H4,2)
 
or ROUND(D4-H4,1) for more precision... is it matters. The 1 is the number of decimal places.

You can also 'format' the cell, from the Format menu... and set it to number, with 1 decimal place... this will display the number with only one decimal place, but calculations carried out using the value will use the full, unshortened value, if you want to avoid rounding errors.