Rounding Down

Z

zann

I'm looking for a way to format a cell to automatically
round down to the hundredths. (I don't mean a function
like ROUNDDOWN.)

My example is I want cells containing currency values
(doesn't have to be the "currency" format--may be any
format with two decimal places) to always be rounded down
to the penny instead of the nearest cent.

Any suggestions would be greatly appreciated :)
 
F

Frank Kabel

Hi
without VBA no chance to do this with a format
you could use the formula
=ROUNDDOWN(A1,2)
in an adjancent column and copy this down for all rows
 
G

Guest

That's what I was afraid of! I have some VB experience.
If anyone knows the VBA solution, if it's not too long,
please post it :)
 
B

Bernard Liengme

How do a penny and a cent differ? I assume you are using US slang for penny.
 
F

Frank Kabel

Hi
try the following macro (rounds down the current selection)
sub round_it()
dim rng as range
dim cell as range
set rng = selection
for each cell in rng
if isnumeric(cell.value) then
cell.value=application.worksheetfunction. _
rounddown(cell.value,2)
end if
next
end sub
 
Z

zann

Thank you for the idea, but that is the same to me as
using a function in this case. I need to not require a
new cell or column :)
-----Original Message-----

=INT(A1*100)/100
 

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