Excel formula for rounding a value & error

In summary, In order to round values and their errors in a physics lab report, there are a few different options available. One option is to use the Format Cells feature to manually set the number of decimal places to be displayed for a particular cell. Another option is to use a formula expression to perform the rounding, using the INT function and multiplying by a power of 10. It is important to specify the exact rounding specifications in order to get the desired results. Excel's ROUND function may not always give the desired results, so it is recommended to test and verify the results before using it for rounding in a physics lab report.
  • #1
phy9
4
0
I'm having a physics lab in which a report needs to be submitted after an experiment.
The experiment includes many measurements: values with their errors.
I need to round the error up to 2 significant digits, and then to round the value up to to the amount of digits that the error is presented.

For example:
* The measurement [tex]123.4567 \pm 0.489583[/tex] will be rounded to [tex]123.46 \pm 0.49[/tex]
* The measurement [tex]123.4567 \pm 1.006[/tex] will be rounded to [tex]123.0 \pm 1.0[/tex]

Instead of doing this manually, I thought to myself that probably someone already wrote a formula for Excel that will accomplish this, while considering all possible/problematic situations (unique scenarios).

So this is my attempt at finding the formula.. did you wrote a formula like that? Or could you please refer me to a place that has it?

Thank you..
 
Physics news on Phys.org
  • #2
H i phy9:

I assume you have separate cells for the value and the error range of a measurement. I also assume the the measurement values are the result of a calculation performed by a formula expression.

I am not sure what you are trying to do. I see two possibilities:
1. Do you want to control the appearance of what shows up in the cells of the spreadsheet?
2. Do you want the content of the cell to be rounded?

If (1), you would use the Format Cells feature to set the number of decimal places to be displayed for a particular cell.
If (2), you can write an expression that will perform the rounding, and the value of the cell would be actually rounded as you may want. The trick is to multiply the value you want to round by a power of 10 so that all desired digits are to the left of the decimal point. Then you round to an integer by using INT(x+.5), where x is the expression for the result of the multiplication. Then you divide by the same power of 10 you originally multiplies by.

Using your first expample, i assume you have a formula in a cell that results in 123.4567, say, "=a1*b1". You would modify this as:
=INT(100*a1*b1+.5)/100​

I hope this is helpful.

Regards,
Buzz
 
  • #3
phy9 said:
possible/problematic situations
It depends what constraints should be satisfied.
Consider 3.456±0.486 = 2.970 to 3.942
Option 1: Round to nearest first: 3.456±0.486 => 3.46±0.49 = 2.97 to 3.95 = 3.46±0.49
I would argue this is the least accurate.
Option 2: Round to nearest after: 3.456±0.486 = 2.97 to 3.942 => 2.97 to 3.94 = 3.455±0.485 (ouch)
Option 3: Round after, down for -, up for +: 3.456±0.486 = 2.97 to 3.942 => 2.97 to 3.95 = 3.46±0.49
The rationale behind the third option is that you might want to ensure that the final answer encompasses the whole range of the original statement.
Note that with different values, it can encounter the same ".005" problem as option 2.
Buzz Bloom said:
=INT(100*a1*b1+.5)/100
Isn't that the same as using the ROUND() function?
 
  • #4
Hi Buzz,

I had thought of something like that but I'm looking for something that will round the numbers automatically in a given column, where one column is the value and the adjacent column is the error.
This method is better, because that this way I don't need to refer to every cell of error & value (there are many measurements so it will take time..).

------

Hi haruspex,

Option 1 seems exactly what I'm looking for - these are the requirements of the course..

I thought that there is a global standard of rounding values & errors regarding physics lab reports..
 
  • #5
haruspex said:
Isn't that the same as using the ROUND() function?
Hi @haruspex:

Unfortunately I can't at the present time check on what Excel does with ROUND. I have a vague recollection that it is not the same as the formula I posted for negative numbers. I also vaguely remember beginning to use the formula I posted rather than ROUND for some specific reason I don't now remember, but it may have been because of the way negatives were done.

Regards,
Buzz
 
  • #6
phy9 said:
I had thought of something like that but I'm looking for something that will round the numbers automatically in a given column, where one column is the value and the adjacent column is the error.
Hi @phy9:

I don't understand what your specifications are for the rounding you want. How is the fixed formula you use to do the rounding going to "know" the number of decimal places you want? II think you mentioned that the following is what you want.
Option 1: Round to nearest first: 3.456±0.486 => 3.46±0.49 = 2.97 to 3.95 = 3.46±0.49​
This seems to be saying you want to round only the least significant decimal place in your data. But this doesn't match your examples.

Can you write down the exact specification of what you want?

Regards,
Buzz
 
  • #7
Buzz Bloom said:
Hi @haruspex:

Unfortunately I can't at the present time check on what Excel does with ROUND. I have a vague recollection that it is not the same as the formula I posted for negative numbers. I also vaguely remember beginning to use the formula I posted rather than ROUND for some specific reason I don't now remember, but it may have been because of the way negatives were done.

Regards,
Buzz
I can imagine it might do something mathematically inappropriate with negative arguments for ROUNDUP and ROUNDDOWN, but I'd be surprised if ROUND did anything weird.
 
  • #8
haruspex said:
I'd be surprised if ROUND did anything weird.
Hi haruspex:

Unfortunately I can't test it now. I am not sure it does something weird. I think it may be something like not rounding an exact 0.5 in the direction I wanted for negative numbers. It was a long time ago.

Regards,
Buzz
 
  • #9
Buzz Bloom said:
Hi haruspex:

Unfortunately I can't test it now. I am not sure it does something weird. I think it may be something like not rounding an exact 0.5 in the direction I wanted for negative numbers. It was a long time ago.

Regards,
Buzz
I'll believe that, it's analogous to the issue I would anticipate with ROUNDUP/DOWN. But I wouldn't consider it serious since the "round halves up" convention is arbitrary. (In this regard at least, life would be simpler with an odd number system base.)
 
  • Like
Likes Buzz Bloom
  • #10
haruspex said:
I'll believe that, it's analogous to the issue I would anticipate with ROUNDUP/DOWN. But I wouldn't consider it serious since the "round halves up" convention is arbitrary. (In this regard at least, life would be simpler with an odd number system base.)
Actually, rounding in a number system having an odd base isn't particularly easy,unless there is only a single digit beyond the place you're rounding to.

For example, n base three (ternary) consider rounding 4.6 (decimal), to one's place.

Easy enough in base ten (decimal).

In ternary 4 and 6 tenths is written:
11.12101210121...three

It turns out that you need to do more than simply look the digit to the right of the place you're rounding to.

1/2 is
0.11111111111111...3 , so compare digits to that.
 
  • #11
SammyS said:
It turns out that you need to do more than simply look the digit to the right of the place you're rounding to.
Sorry, I'm not seeing the difficulty. Could you spell it out a bit more, please?
 
  • #12
haruspex said:
Sorry, I'm not seeing the difficulty. Could you spell it out a bit more, please?
Suppose that you are to round the following number, written in base three, to the nearest whole number:

11.121

You can't simply look at the 1 to the right of the point.
 
  • #13
SammyS said:
Suppose that you are to round the following number, written in base three, to the nearest whole number:

11.121

You can't simply look at the 1 to the right of the point.
Ok, I see. The rule becomes, if the digit you want to end at is a 1 then you need to scan right to the next 0 or 2 to decide.
 
  • #14
haruspex said:
Ok, I see. The rule becomes, if the digit you want to end at is a 1 then you need to scan right to the next 0 or 2 to decide.
Yes.

In base (2n - 1), scan to the right looking for the first digit greater than n or the first digit less than n.

However, you are correct in noting that there will be no "ties" as there are with even bases.

By the way, for other readers of this thread,

the base three number, 11.121 , is 4 and 16/27 .
 

FAQ: Excel formula for rounding a value & error

What is the Excel formula for rounding a value?

The Excel formula for rounding a value is =ROUND(). This function takes two arguments: the number you want to round and the number of decimal places to round to. For example, =ROUND(5.678,2) would round 5.678 to 2 decimal places, resulting in 5.68.

Can I use the ROUND function to round to the nearest whole number?

Yes, you can use the ROUND function to round to the nearest whole number by specifying 0 as the number of decimal places. For example, =ROUND(5.678,0) would round 5.678 to the nearest whole number, resulting in 6.

What does the Excel formula for rounding do when there is an error in the value?

If there is an error in the value being rounded, the ROUND function will return an error. This can happen if the value is not a number or if the number of decimal places specified is negative.

Is there a way to handle errors in the Excel formula for rounding?

Yes, you can use the IFERROR function to handle errors in the Excel formula for rounding. This function takes two arguments: the formula to evaluate and the value to return if the formula results in an error. For example, =IFERROR(ROUND(A1,2),0) would round the value in cell A1 to 2 decimal places, and if there is an error, it would return 0 instead.

Can I round a value to a specific multiple using the Excel formula for rounding?

Yes, you can use the MROUND function to round a value to a specific multiple. This function takes two arguments: the number you want to round and the multiple to round to. For example, =MROUND(5.678,0.5) would round 5.678 to the nearest multiple of 0.5, resulting in 5.5.

Similar threads

Replies
31
Views
2K
Replies
6
Views
3K
Replies
4
Views
5K
Replies
2
Views
5K
Replies
19
Views
5K
Back
Top