Rounding A Number Up To The Next Value In A Custom List

Nov 17, 2008

I have a scenario where I calculate the size of a piece of process equipment, and then select the next highest size from a list of standard equipment that we supply.

I've managed to write an ugly brute-force solution to a relatively straightforward previous situation, but I'm reluctant to redo the entire exercise when I'm sure there's a more straightforward way of doing this.

An example of the problem:

We sell equipment in sizes 1, 3, 8, 12 and 25. I calculate that the piece of equipment theoretically needs to be size 19.6. I want a formula that will automatically generate the answer to this as 25. Similarly, if my formula shows a theoretical size of 12.01, I want the formula to state the actual size as 25.

My previous method of solving this was a series of nested ifs, searching for the rounded value of my formula output, then that value +1, then +2 upto a maximum of +5. This wasn't a pretty sight, but it worked for that situation.

Are there any other ways of solving this that are more elegant than mine?

View 9 Replies


ADVERTISEMENT

Custom Rounding And IF Statement In One Formula

Aug 3, 2013

Round to Nearest Half Based On Defined Range of Decimal thread.

So here is what happens in the first half of the equation....I round numbers to the nearest half based on a specific range of decimals in the original number. For example if the number in A1 is:

28.0 to 28.399 then rounds DOWN to 28
28.4 to 28.799 then rounds to 28.5
28.8 to 28.99 then rounds UP to 29

For this I am using shg's equation:

[Code] ........

This is all I needed for most of my numbers.....but one part goes one step further.....

NOW THE SECOND HALF......Once the first half of the equation rounds the number above, I need the second half of the equation to then do the following. If the resulting number from the first part of equation above is:

1 through 3 = its own size (1 is 1, 1.5 is 1.5, 2 is 2, 2.5 is 2.5, 3 is 3)
3.5 to 7 = 3
7.5 and above = 4
Resulting number from last part of the formula multiply by 2

So this will end up being only 1, 1.5, 2, 2.5, 3, or 4 multipled by 2.

I am pretty sure this second part would be an IF statement (or maybe there is a more efficient way), but I am still learning the ins and outs of that....but I don't know how to use the first formula and add the needed second part into all one formula.

View 8 Replies View Related

Rounding Number And Then Shrinking Number Of Digits To Fit With Narrow Column

Feb 6, 2013

I have a number, eg, 1234567 and rounded to prepare the shrink of the size of the number like

= Round(a1, -3). I have, say now, 1234000.

I need to strip "000" from the number and place 1234 to a cell.

View 4 Replies View Related

Rounding Up Calculated Value To Value Within List?

Nov 30, 2012

I have a list of figures (around 100 long) and I have a field which calculates a value somewhere within the range of the list (between the lowest and highest value in the list). I would like to round my calculated value UP to the closest value within the list.

For example

List : 1 3 5 7 8 9 11 13 15
Calculated value =9.4
Therefore the rounded up value I want to obtain is 11.

View 4 Replies View Related

CSV Number Rounding

Oct 25, 2009

I have a section of code that build a single sheet workbook that incudes names and phone numbers to upload in to a web site.

The numbers are in internation format eg 4412345678987

The code works fine but when it saves as a CSV Delimited it round the numbers up so they end up 4412346000000.

View 9 Replies View Related

Rounding A Number ...

Jul 4, 2007

I thought this was really easy and I swear that I did this before but I can't remember it at all. What I'm trying to do is take 2 user inputted dates and subtract them to get the total days. After that I divide it by 7 to get the total weeks. and ususally I will get a decimal. However I need to round this up to the next whole number.

View 9 Replies View Related

Rounding A Number Up In A Cell

Jan 28, 2009

I need to round up the answer of 1.72 to 1.73 for the formula listed. The formula in that cell reads as follows: =(22/12.762)

View 2 Replies View Related

Rounding To Specific Number

Feb 28, 2012

I have a column of numbers that represent sales prices.

If the price ends in anything between .x0 - .x4 I want the replacement number to be .x4 and if anything between .x5 - .x9 I want the replacement number to be .x9.

For example, the sales price is 1.93. The "rounded" number should be 1.94.

More examples:

3.76 = 3.79
3.13 = 3.14
2.50 = 2.54

View 9 Replies View Related

Rounding A Number To The Nearest Five

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

Dividing A Number By 12 With Respect To Rounding

May 23, 2007

Suppose I have the following plan number (24) and I wan't to spread it across 12 columns, as evenly as possible but with respect to rounding.
Easy enough.. Each column receives 2...

Or say the figure was 24.6 and i wanted to round to 2 places...
Easy enough... Each column receives 2.05...

Or say the figure was 24.7 and i wanted to round to 2 places...
Easy enough... Each column receives 2.05... But one would be 2.06!

How about the number is 1 and say, the rounding is 0.1?
Ten of the columns would be .1 while two others (arbitrarily) would be 0.

View 9 Replies View Related

Rounding Up A Cell Value To Next Highest Whole Number

May 4, 2006

I have a whole number value in cell F18. In cell F24 I want to enter a formula that allows me to divide the value in cell F18 by 4 and if the result is not a whole number, round it up to the next whole number.

View 2 Replies View Related

Rounding Up A Number To The Nearest 25th

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

Excel 2010 :: Rounding Number Of Years?

Sep 6, 2012

I'm using the following:

B23=IF(A23="","",DATEDIF(A23,I3,"y"))

Where:
A23 = a date of installation
I3 = TODAY()
B23 = a number of years

It currently calculates correctly if the number of years correctly if it's older than 1 year. If under one year, it yeilds 0. I would like B23 to show 1 if the current formula yeilds 0.

I want it to yeild a 1 if the current calculation is 0.

Windows 7 Ultimate / Excel 2010

View 6 Replies View Related

Macro To Convert Text To Number Without Rounding

Mar 27, 2014

This is what I have so far.

Code:

Range("L:L").Select
With Selection
Selection.NumberFormat = "General"
.Value = .Value =
.NumberFormat = "0.0"

[Code]...

The .NumberFormat = "0.0" is newly added and doesn't work.

View 9 Replies View Related

Rounding Number In Formula To Remove Decimal

Sep 19, 2006

My formula is not rounding properly. Cells I4, J4 and K4 all filter from the results of cell I3 divided by 3. (e.g. 10/3 = 3.333) I was able to remove the decimals in cells I1:K3, but the between formulas (I4:K4) keeps adding the decimal back, therefore this results in errors to my chart.

View 4 Replies View Related

Round To Nearest Even Number. Bankers Rounding

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

Rounding Formula :: Round To The Nearest Integer (whole Number)

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

Custom Number Format For 0 (zero) Number - Make It Center Alignment

May 11, 2014

i am looking for excel custom number format for 0 (zero) number that make center alignment..

for example ;

sample (when type 0 (zero) number)
after custom number format
- (right alignment)
- (center alignment)

how make center alignment with custom number format for 0 (zero) number..

View 4 Replies View Related

Banker's Rounding Or Scientific Rounding

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

Rounding A Number To Next Whole Number

Jul 4, 2007

I'm trying to do is take 2 user inputted dates and subtract them to get the total days. After that I divide it by 7 to get the total weeks. and ususally I will get a decimal. However I need to round this up to the next whole number.

View 9 Replies View Related

Finding The Biggest Value In Custom List?

Apr 26, 2014

I know how to make customs lists, but it's not getting me anywhere.

Let's say I have a lot of data containing values as follows and in the following list I sorted them from small to large:

5a
5a+
5b
5b+
5c
5c+
6a
6a+
6b
6b+
6c
6c+
7a
7a+
7b
7b+
7c
7c+
8a

and so on... In the list, the date isn't sorted from small to large, many values (if not all) occur multiple times and on occasion some values are added to the column. With that last part I mean that you can see it as a batch of 500, and if so far the batch only contains 450 values there will be (for the time being until items get added) 50 empty cells in the column as well.

You can't order numerically or alphabetically. I know I can make a custom list and then just sort according to that custom list so the biggest value would come out on top or bottom but that's not what I'm looking for either, as the data needs to be sort by another colomn (dates in chronological order).

So I'm just looking for a formule saying "return the biggest value if the order of things is as I typed above'.

View 14 Replies View Related

Custom Validation List With Conditions

Oct 17, 2013

I am trying to create a validation list, with its source data being filtered from another sheet of the same workbook. I also need to validate the drop list against some conditions in the source table.

Here is an example of the data am trying to create`(I want to create the droplist for the column Contract):

"Contract Definition" Sheet or Table:
-----------------------------------
Company Contract Service Report End date: Status
--------- --------- -------------- --------- ------
CompanyA ContractA1 Service 1 31/12/2014 Active
CompanyA ContractA2 Service 2 31/12/2014 Active
CompanyB ContractB1 Service 1 31/12/2014 Inactive

"Service Reports" Sheet or Table:
--------------------------------
Company Contract Service Report
--------- --------- ----------------
CompanyA ContractA1 Service 1
CompanyA ContractA1 Service 2
CompanyA ContractA2 Service 3

In the Service Reports Sheet, i want to create a list for each Contract, based on the specified Company and on the Status field, as defined in the Contract definition table.

View 8 Replies View Related

Add Custom Sort List To VBA Code

Mar 12, 2009

I have a Macro that I have recorded that autosorts several columns for me. This works fine as I have 5 columns that need to be sorted in a particular way.

The problem is that I have a custom list which I stored using the: Tools>Options>Custom List tab. Now this works fine on my pc as I have the custom list stored on my PC.however the problem is when someone else uses it on their PC it may no longer work as they won't have my custom list stored on their PCs.

Is there a way to store the custom list in a Macro and then use that list to sort to the criteria needed. For example "One, Two, Three, Four" will not store in alphabetically, so hope would I be able to sort so that they would appear in a chronological manner? Below is the code for the Macro I recorded. As you can see one of the lines says "OrderCustom:=6"; this I am assuming is reading from the list I created.

View 2 Replies View Related

Using Custom Sort List Within Macro

Aug 3, 2009

I have following code, which sorts data if user "double clicks" on cells A1, B1, C1, or D1. If the user "double clicks" on cell D1, I want to sort by column D but I want to apply a custom list. The data is in the "Custom Lists" table but I can't figure out how to apply to my code.

The sequence/sort order of the list is as follows:
aaa+, aaa, aaa-, aa+, aa, aa-, a+, a, a-, bbb+, bbb, bbb-, bb+, bb, bb-, b+, b, b-, ccc+, ccc, ccc-, cc+, cc, cc-, c+, c, c-, ddd+, ddd, ddd-, dd+, dd, dd-, d+, d, d-
code is as follows:

View 3 Replies View Related

Delete List Of Custom Formats

Feb 28, 2013

When you right click on your mouse, and you select:

Format Cells...NumberCustom
You can see many formatting styles.
Some of them impossible to delete eg: "General" or "@"

But some others easy to delete one by one pressing the Delete button.

In my Workbook eg "#.##0,00 ;[Red]-#.##0,00 ;; @"

Is there any way of deletting all of then by vba.

I mean all the different custom formats that I am carrying from book to book, from job to job long time ago.

I would like to have just the ones excel gives us by default, not the rest.

View 1 Replies View Related

How To Create Custom Sort List

Aug 25, 2013

I am trying to create a custom sort list by going to preferences/custom lists and typing 37 items into a new list in Excel. It will not take all of the items after I type them in. Is there a limit as to how many items can be in the list. It seems to only take 18-20 items out of the 37 and erases the rest.

View 9 Replies View Related

Custom List To Sort Data

May 28, 2014

I am having trouble finding info on this. I am trying to create a custom list to sort data.

I only want to sort two of the letters in my first Level or Column. For instance I want to sort Column A Alphabeticaly as A, B, C, D, but once I get to E, have the rest of the list in a random order that is sorted by my next level. Is there a wildcard character that can be used to have my next sorting level take over once I get to E?

View 4 Replies View Related

Add List As A Subchoice To A Custom Menu

Jun 2, 2006

I have create a custom menu and want to add a choice and a subchoice that will guide the user to insert a number in an inputbox or under a list. Then the user's selected number it will be used as parameter for a vba code.

Eg.:
The choice is: How many rows will be marked
The subchoice : 10 (default value)

What i want is the following:
If the user choose the above subchoice then it has to be appeared an inputbox or something like that in which he has to insert a number, eg. 45. After that the choice must shows

The choice: How many rows will be marked
The subchoice: 45

This parameter must be active all the time that the user uses the workbook. At the end, if the user saves the workbook, the next time it will be opened, the subchoice must have the value 45.

Look at the attachment image to see exactly what i want
Here's the code. Just copy it under a module

Option Explicit

Dim cbMenu As CommandBarControl
Dim cbSubMenu As CommandBarControl
Public MenuSeries

View 9 Replies View Related

Custom List Order Of Names

Mar 21, 2008

I Have A List That Is Generated From Another Program Dump Info Into Excell.
This List Has Names In One Colun And Corresponding Values In The Next Column. My Goal: Get The Name And Values To Be Listed In A Specific Order To Be Copied To Another Workbook. Issue: All The Names Do Not Always Get Sent From Original Program. Example:

Person1 Always Needs To Be In Row2
Person 2 Always Needs To Be In Row3
Etc
However Person1 May Not Be On The List Today. In Which Case I Need Row2 Blank

View 2 Replies View Related

Custom Number Formats

Mar 20, 2009

I need to create a custom number format for a recorded delivery number in an excel sheet. I want it to look like AA 1234 1234 1GB in the cell even if the user enters it without spaces e.g. AA123412341GB. I have had a bit of a play around with underscores to get spaces but nothing seems to make it change.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved