Rounding down to specific numbers

S

Srfnski2be

I need to round down the following formula to one of a group of specific
numbers: (30, 27, 24, 21, 18, 15, 12, or 9)

ActiveCell.FormulaR1C1 = "=(r6c3)-1 3/4"

so if the number in (r6c3) is 24 then i need it rounded to 21
.... if the number is 22 then i need it rounded to 18.

How can i make that formula
 
J

JE McGimpsey

If I understand correctly:

ActiveCell.FormulaR1C1 = "=FLOOR(r6c3 - 1.75, 3)"


or, if you're just interested in the Value, not a formula:

With ActiveCell
.Value = Application.Floor(.Offset(5, 2).Value, 3)
End With
 
S

Srfnski2be

Worked great. Thanks

JE McGimpsey said:
If I understand correctly:

ActiveCell.FormulaR1C1 = "=FLOOR(r6c3 - 1.75, 3)"


or, if you're just interested in the Value, not a formula:

With ActiveCell
.Value = Application.Floor(.Offset(5, 2).Value, 3)
End With
 

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