Round then round?

P

pgarcia

Hello all,
Cell A1= 5.5556, I need to round that number (5.56) then multiply by 1.09
and round again. I'm looking for just one formula to do all three. Thanks
 
J

John C

Assuming A1 is your value of 5.55556, and B1=1.09
C1: =ROUND(ROUND(A1,2)*B1,2)

or, if the 1.09 is static, you could hardcode it in like so:
=ROUND(ROUND(A1,2)*1.09,2)
 
A

Arlen

With cell reference (pretend your numbers are in A1 and A2)
=ROUND(ROUND(A1,2)*A2,2)

or, with real values

=ROUND(ROUND(5.5556,2)*1.09,2)

The End.
 
P

pgarcia

Thanks, I didn't know you could nest "round".

John C said:
Assuming A1 is your value of 5.55556, and B1=1.09
C1: =ROUND(ROUND(A1,2)*B1,2)

or, if the 1.09 is static, you could hardcode it in like so:
=ROUND(ROUND(A1,2)*1.09,2)
 
R

Rick Rothstein \(MVP - VB\)

All functions can be nested... a function just returns a value which can
then be used by the function it is embedded in (the only thing you have to
watch out for is that the parent function's argument position is compatible
with the return type of the embedded function; for example, if the parent
function's argument is expecting a simple value, you can't place an
array-generating function call there, and vice-versa).

Rick
 
P

pgarcia

Is there VB code equivalent to this?
Here is part of my code.

Range("T13").Select
ActiveCell.FormulaR1C1 = "1.25"

Set r = Range("K11:Q500")
Set r = r.Offset(1, 0).Resize(r.Rows.Count - 1)

On Error Resume Next
Set r1 = r.SpecialCells(xlVisible)
On Error GoTo 0
If Not r1 Is Nothing Then
Range("T13").Copy
r1.PasteSpecial Paste:=xlValues, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
 
Top