Custom Formatting

T

Tarfun

What is the custom format to display numbers to the nearest 100 or nearest
10, i.e., 721 be displyed as 700 or 720. I know that formattig a number that
way will retain its unrounded value in memory for all computations performed
using it. (Not so using the "Round" Function.)
 
J

John C

What are you trying to do? If I understand what you are writing below, you
want a number, for example, 721, to be entered as 721, treated in all
calculations as 721, but what is displayed is only 700?
Wouldn't this cause some concern if, for example, you knew 2 numbers were
supposed to be added up, but it looked very wrong.
i.e.:
700 (721) + 600 (647) = 1400 (1368)

If not, please explain more.
 
T

Tarfun

John, I know what I want to do, but not how to do it. I'm involved in
preparing a large organization's budget. The distinction between looking at
721 and 720, or even 700, in a $5-million budget is meaningless (and
distracting) so long as the subtotals are roundings of the real numbers. So I
ask again, what is the custom format for rounding numbers the nearest 100 or
nearest 10?
 
J

John C

Unless you have xl2007 (I don't), I don't think it is possible to do what you
want to do. What I recommend would be to use the round function, for example:

Say you are adding a bunch of numbers from col C to col G into col H
H2: =ROUND(SUM(C2:G2),IF(SUM(C2:G2)>100,-2,-1))
this copied down to row 20.
But then, you have the total of col H in H22
H22: =ROUND(SUM(C2:G20),IF(SUM(C2:G2)>100,-2,-1))

Essentially, in the cells you want to display to the nearest 100s or 10s,
use the rounding function, but when you are calculating, use the original
formula that helped you to arrive at the 'rounded' number.
 
T

Tarfun

John,
Thanks for your efforts, but I've already considered proceeding as you
suggested. That may work for someone skilled in navigating Excel, but it is
not something I could turn over to a clerk to use regularly for a display of
four or more columns, with 15 to 20 subtotals in each column. I'm not certain
I'd want to contend with that either.

In <Format><Cell><Number><Custom> one can enter the following new number
format to round numbers to the nearest 1,000: #,",000"

That only changes the displayed number, but does not change the value stored
for computations. Seems to me that rounding a number to the nearest 100 or
nearest 10 should also be possible if only we knew the entries to make in the
Custom Number Format screen. Maybe someone else out there has an answer.

Thanks again.
 
G

Gord Dibben

Formatting changes only the display of the number.

No formatting can change the actual number.

You will use the ROUND function in formulas or event code to round the
numbers as you enter them.


Gord Dibben MS Excel MVP
 
T

Tarfun

Exactly. I want to change to display but not the stored number. I know how to
display to the nearest 1,000. I want to know how to display to the nearest
100 or nearest 10. Are those other format displays possible? If so, how.
 
J

John C

Not knowing exactly how the displayed as rounded (but not really rounded
numbers) are arrived at, I do have 2 more 'suggestions' that you could work
on. Both essentially involve a second worksheet.
1> If the user is just entering the numbers, just have a second tab modeled
after the first that emulates the entry tab, but with a display that looks
how you want.
2> Using VBA (that is currently beyond my capacity), when someone enters a
specific piece of data, use VBA to first take the entered data, enter on a
hidden sheet, and then change the display of the sheet entered on.

Oh, wait, I do have a 3rd suggestion. Get xl2007, I am fairly certain it can
do what you want (though not 100% positive). Wished I could have been more
help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top