Rounding and IF/Then Formulas

Robert V.

New Member
Joined
Aug 9, 2010
Messages
3
I need to round the result of the following formula to 2 significant figures:

=IF(B21>0,B21/$B$10/($B$11/100),"")

The following formula seems to work well for rounding to 2 sig figs:

=ROUND(C21,2-(1+INT(LOG10(ABS(C21)))))

How can I combine these formulas to yield a nicely rounded result in C21?

Thanks!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Robert - you just need to make the rounding the last action in the formula.

so your formula will become:

=ROUND(IF(B21>0,B21/$B$10/($B$11/100),""),2)

trust this helps, Ian R.
 
Upvote 0
I think I may have figured out the formula so that it will round the result AND ensure that the cell is blank if there is no number in the adjacent cell:

=IF(B26>0,(ROUND(IF(B26>0,B26/$B$10/($B$11/100)),2-(1+INT(LOG10(ABS(B26/$B$10/($B$11/100))))))),"")

Robert
 
Upvote 0
Robert - in comparing the formulas, if you use B10 = 151, B11 = 2, B26 = 50 then your result becomes 17.00. My result is 16.56 as I thought you needed 2 significant figures i.e. 2 decimal places.

Perhaps you require just the integer? If so I woud suggest

=IF(B26="","",IF(B26>0,ROUND(B26/$B$10/($B$11/100),0),""))

If you use B10 = 200, B11 = 2, B26 = 3 then your result becomes 1.00 rather than 0.75

I hope this helps, Ian R.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top