If statement with rounding

ohlegend

New Member
Joined
Jun 23, 2011
Messages
4
I am trying to write a statement the rounds the calculated data to 1 if the calculated number is less than 1. If the calculated number is greater than 1, I want the calculated number to be displayed. For Example:

Num 1 = 20
Num 2 = 40

Num 1/Num 2 = .5 ( I want to round up to 1 on this instance)

Num 1 = 80
Num 2 = 40

Num1/Num2 = 2 ( I want to output the 2 in this instance )

Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Wrap the whole thing in a MIN(1,if(....................)) statement.

Any value less than 1 wil then calculate as 1
 
Upvote 0
=if(mod(b12,b13)=0;b12/b13,round(b12/b13,1))
 
Upvote 0
Wrap the whole thing in a MIN(1,if(....................)) statement.

Any value less than 1 wil then calculate as 1


Max and Min can be a little confusing...You actually want MAX here..

MIN - Returns the SMALLEST of the given numbers
MAX - Returns the LARGEST of the given numbers
 
Upvote 0
What if I wanted to add a statement that says:

Do the calculations mentioned above, but if there is nothing in cell B4, leave the cell blank?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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