Rounding To The Nearest 5 (VB Code)
Dec 31, 2007
In cell A1, I might have the following numbers: 1, 5, 10, 50, 100.
In cell B1, I will have an unknown number
In cell C1, I want to round the number in B1 using the information given in A1.
For example:
A1 = 1
B1 = 153.45
C1 should be 153
C1 = round(B1,0)
A1 = 5
B1 = 153.45
C1 should be 155
C1 = round(B1,0) +/- 5 (depending on the situation)
A1 = 10
B1 = 153.45
C1 should be 150
C1 = round(B1,-1)
A1 = 50
B1 = 153.45
C1 should be 150
C1 = round(B1,-1) +/- 50 (depending on the situation)
Is there a quick of doing this using VB? I can do a bunch of if then statements... but was wondering if there's an easier way.
View 9 Replies
ADVERTISEMENT
Mar 11, 2009
I have excel 2003. I'm working on a weight lifting program and need to have cells round to the nearest 0 or 5. My problem is that the cells I need to round already have a formula in them and I can't get the cell to round the answer of the formula.
D17=U4*.6
I need the answer to be rounded to the nearest 0 or 5.
View 9 Replies
View Related
Nov 2, 2006
I wish to apply a rounding rule that will correctly round up or down to the nearest 5 or 0.
I tried using ceiling and floor and am almost there, but not quite.
Rule is to round up or down to nearest 5 or 0
originalplancfcheckroundedrulewill use
634should be 630635630f634
634.4should be 630635630f6343f
634.5should be 635635630c6352c
634.6should be 635635630c6352c
635should be 635635635c Or f6351f
635.1should be 635640635f6351f
635.5should be 640640635c6364c ...............
View 9 Replies
View Related
Jun 28, 2012
I have downloaded a punch in time clock from another user " Alex17", great job by the way. I was wondering on how to apply some certain rules this. I would need the times to round to the nearest quarter. Let's say someone punched in @8:01AM or any time up to 8:07AM, I would need it to round to 8:00AM, if they punched in from 8:08AM up to anytime to 8:14Am, I would need that to round to 8:15AM or if someone punched in @ 8:23AM it would round to 8:30AM....etc. I attached the form.
I need these rules to apply
7:00 - 7:07 round down to 7
7:08 - 7:15 round up to 7:15
7:16 - 7:22 round down to 7:15
7:23 - 7:30 round up to 7:30
7:31 - 7:37 round down to 7:30
7:38 - 7:45 round up to 7:45
7:46 - 7:52 round down to 7:45
7:53 - 8:00 round up to 8
or if this makes more sense
7:00 - 7:07 round down to 7
7:08 - 7:15 round up to 7.25
7:16 - 7:22 round down to 7.25
7:23 - 7:30 round up to 7.5
7:31 - 7:37 round down to 7.5
7:38 - 7:45 round up to 7.75
7:46 - 7:52 round down to 7.75
7:53 - 8:00 round up to 8
View 4 Replies
View Related
Sep 18, 2009
I write up job cards that require measurements in fraction form. Usually whenever i want to round off a figure , say 10/16, to 5/8, i right click on the figure and format cell it. However, this can be quite time consuming if there are multiple cells and are of a different breakdown.
What i would like to know if there's a shortcut way where when the 10/16 is in the cell, it automatically rounds off to the nearest fraction.
View 9 Replies
View Related
Oct 16, 2007
How do I round $452.57 in cell A1 to $453.00? I want to format the cells to round to the nearest dollar and leave the .00 cents.
View 9 Replies
View Related
Feb 26, 2009
I was looking at the other posts and this should work. Why the bleep can't I get the MROUND function to work. Simple scenario...I need to round UP numbers to the nearest 50. 320 should bring back 350, 351 should bring back 400.
For example, if this is in cell A1, I think the formula should be =MROUND(A1,50). Yet everytime I use the function, it gives me NAME#.
View 11 Replies
View Related
Feb 27, 2004
I am trying to round a number down to the nearest 1/4". For example;
Round Down 8.80" to 8.75".
Is there any combination of Rounddown and Mround that will accomplish this?
View 9 Replies
View Related
Sep 16, 2006
I have an overtime spreadsheet where I calculate how mush I'm paying on vouchers, as they only come in lots to £5.00 I want to round the figure to the nearset £5.00, doesn't really matter if I overpay as it will even out next time, what's a basic forumula to work this out?
View 6 Replies
View Related
Sep 25, 2008
I need to round, up or down, dollar figures to the nearest .x9 cents. Examples:
$4.32 = $4.29
$5.55 = $5.59
$3.07 = $3.09
$5.00 = $4.99
View 3 Replies
View Related
Oct 27, 2006
I have a cell that returns a value...lets say "439". I need the cell to automatically round the number up to the nearest 25th. Like this:
439 would become 450
521 would become 525
551 would become 575
View 2 Replies
View Related
Jun 26, 2007
Need best method to round the value up or down to the nearest 5¢.
I have to do this to upgrade my budgetting spreadsheet's shopping list due to our government discarding the 1¢ and 2¢ coins
I must admit I really don't even know how to round only the cents of the value which is all I really all I want to do I spose, isn't it
I don't really understant the MSexcel's ROUND function instructions and can only round the integer not the ?float? part Can you help MrEXCEL
EG: RoundedOK.??¢ where all I want to round is the .
View 9 Replies
View Related
Mar 16, 2007
What formula could I use to round up or down time values to the nearest 6 minute increment?
Example:
Time ----> Rounded To
5:02 PM --> 5:00 PM
5:03 PM --> 5:06 PM
4:18 PM --> 4:18 PM
4:19 PM --> 4:18 PM
4:20 PM --> 4:18 PM
4:21 PM --> 4:24 PM
etc.
View 6 Replies
View Related
May 15, 2008
We are trying to find the correct formula to round number to the nearest even number. In the attached example, 0.105 should round to 0.10 since the zero to the left of the five is even. If the problem was 0.115 then the answer would be 0.12 since the one to the left of the zero is odd.
View 9 Replies
View Related
Feb 3, 2007
I would like to round this number (3.5) to become 4, but by using this formula =CEILING(A1,0.5) the result will be 3.5
i need a formula that turns 3.5 to 4
when i use this formula =ROUND(A2,0.5), 3.5 becomes 4, but 3.2 becomes 3 not 3.5
i.e. a formula turns 3.2 to 3.5 and 3.5 to 4
View 6 Replies
View Related
Jul 9, 2008
I am trying to round similar to Banker's Rounding or Scientific Rounding but I can't find a consistent formula that works perfect with decimals.
Using three decimal places for all the samples, I can get 0.0785 to round to 0.078 but 0.1785 wants to round to 0.179 instead of staying 0.078. Or 0.0005 will round to 0 but 0.5115 wants to round to 0.511 instead of 0.512.
Here is a list of sample numbers along with desired results:
.0785 should be .078
.5115 should be .512
.5035 should be .504
.0005 should be 0
.0025 should be .002
.0194 should be .019
.0195 should be .02
.0135 should be .014
.0115 should be .012
.8115 should be .812
I cannot find a formula which gives me all of these results. Here is a list of the formulas I have tried so far (NOTE: cell A2 is the working cell in my worksheet where I enter the number to be rounded)
1) =MROUND(A2,0.001)
3) =ROUND(A2,3)
4) =IF(ISERROR(IF(MOD(MID(A2,4,1),2)=1,CEILING(A2,0.001),FLOOR(A2,0.001))),0,IF(MOD(MID(A2,4,1),2)=1,CEILING(A2,0.001),FLOO R(A2,0.001)))
5) =EVEN(A2)
6) =ROUNDUP(A2,3)
7) =ROUNDDOWN(A2,3)
View 9 Replies
View Related
Apr 4, 2014
I have a form to round to nearest quarter but if it is less than 1 hour I need it to round to a total of 1. Can this be combined in one formula.
I also need my time to be configured so that if the start time is a PM number then end time AM it does not figure right. is there a way to remove the AM/PM from time. I have already tried all the formats from number,time, & custom.
Attached is my form : Timesheet Form 2014.xlsx
View 4 Replies
View Related
Feb 20, 2009
I am using the rounding function in excel and its rounding to the 10's, is there a way to round to the nearest 5?
View 4 Replies
View Related
Apr 29, 2013
I need a formula that will roundup the amount in a cell to the nearest 50 (as in 246 £ will become 250 £)
View 4 Replies
View Related
Feb 6, 2010
Below is my current formula. Right now I have it rounding the results to the nearest .09. I would also like to have it round to the nearest .05 as well.
In other words, to be more exact: I need all numbers that end in 0 or 1 to be rounded down to 9; any numbers that end in 7 or 8 to be rounded up to 9; any numbers that end in 2, 3, or 4 to be rounded up to 5; and 6 to be rounded down to 5. And, of course any numbers ending in 5 or 9 shouldn't change.
View 14 Replies
View Related
May 23, 2012
I am using the MROUND function and it will round up or down to the nearest whole 50. Is there a function to round only UP to the nearest whole 50?
ie: 1704 is being rounded to 1700 I need 1704 to rounded to 1750
View 3 Replies
View Related
Jun 9, 2007
I trying to make a formula that will multiply a cell by 1.43 and then round the total up to the nearest 45 or 95 with no decimal points.
View 9 Replies
View Related
Dec 12, 2013
I am looking for a formula which will allow a value to round up or down to the nearest x.99 if the value is greater than x.95 or less x.05 otherwise remain the same. i.e if the value is 0.96 it should read 0.99 and if the value is 1.04 it should read 0.99. however if the value 1.05 it should read 1.05.
View 9 Replies
View Related
Jan 30, 2014
was given only looked at the nearest date and not the nearest date after.
So here goes; I have a table that looks at new starters and the date they started, and then a list of dates appointments offered (these dates can and often do precede to person joining us).
What I'm looking for the first chronological date AFTER the New start Date.
In row 3 this works; as it is the nearest date, but in row 4 however, it is the nearest date; but occurs before the New start Date, thus is incorrect.
View 2 Replies
View Related
May 18, 2009
If I have a date that is 12 February 2008 I need to pick up data next to 31 January 2008 as that is nearest, however if my date is >15th February 2008 I want to pick up the data in the column next to 29 February 2008......
View 2 Replies
View Related
Feb 18, 2013
I need to round numbers up in a spreadsheet to the nearest .05 . For example, I would need to change 1.502 to 1.55 or 1.556 to 1.60 .
View 3 Replies
View Related
Oct 30, 2009
I'm trying to round some figures UP to the nearest .5, However i only know this formula: =MROUND(P2,0.5) and that rounds to the nearest .5? Is there anything i can use instead to make sure it is always up not down. so 6.13 becomes 6.50 or 7.53 become 8.00? etc.
View 2 Replies
View Related
Dec 17, 2009
I have a list in column A that goes [Blue,0,0,0,Green,0,0,Orange,0,0,0,0,0, etc.] The number of 0s is not in any pattern. Based on column A, I would like column B to go [Blue, Blue, Blue, Blue, Green, Green, Green, Orange, Orange, Orange, Orange, Orange, Orange,etc.].
So, I would like column B to look at column A, and if it is a 0, return the nearest color above. I was thinking of maybe using a whole bunch of imbedded "if" functions that would keep going up and up if it was 0 and then return the cell when it's not 0, but sometimes it might be 30 0s, so I'm not sure that's the most efficient way to go about it (or maybe it is and I'm not thinking about it right). Does anyone know a nice neat little function that would work? I've attached a sample spreadsheet that illustrates what I'm trying to do. Column A is what I start with and Column C is where I'd like to be.
View 2 Replies
View Related
Dec 3, 2007
How do I format the date to be to the nearest work day?
I want to establish a due date for an asset that is due 5 days before launch. If my launch date is in A1, and my due date is in A2, in A2 I put:
=A1-5
So how do I make sure that the resulting date is a workday?
View 9 Replies
View Related
Feb 5, 2008
I am trying to solve the nearest neighbour algorithm with vba
For example, I have a table as the following
0 1 2 3 4 5 1
10
5
15
20
2 10
8
9
7
3 5...........
View 9 Replies
View Related