PowerQuery Rounding

SOQLee

Board Regular
Joined
Mar 18, 2015
Messages
58
Office Version
  1. 365
Platform
  1. Windows
How would you round the number 2.33 up to whole number 3 instead of the 2. Power Query's default for 0.33 is to round down and I want to round up.

Also, how would you wrap the ROUND function in a formula when adding the values of two columns.


ValueRoundUpDefault
2.3332
2.6733
3.0033
3.3343
3.6744
4.0044
4.3354
4.6755
5.0055
5.3365
5.6766
6.3376
6.6777
7.0077
7.6788
8.0088

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi SOQLee

In the interface, you can find the round-up function in the ribbon under Transform -> Number Column -> Rounding -> Round Up.
The function itself is Number.RoundUp.

You can use Number.RoundUp(...) within another formula, anywhere that excepts a number type. If you need more help, please post back more details on exactly what you want the formula to do.

Regards,
Owen
 
Upvote 0
Hi Owen,

Thanks for the response. I did use the Round Up function on the ribbon...but was wondering how to write the RoundUp within another formula. For example, I have two custom columns and wondered how to write just one column which would combine the formulas wrapped in a RoundUp statement (thereby avoiding a few PoweQuery steps).

Custom1 = Value.Divide([EndValue]-[StartValue],12)
Custom2 = [EndYear]-[StartYear]

Custom3 = Custom1 + Custom2
 
Upvote 0
Sure, in that case you could create a custom column such as:

Custom3 = Number.RoundUp( Value.Divide([EndValue]-[StartValue],12) + [EndYear]-[StartYear] )
 
Upvote 0
Excellent! I wasn't sure if I had written it correctly. I was getting errors...it was the data type that was throwing Custom3 off. Thank you.

Sure, in that case you could create a custom column such as:

Custom3 = Number.RoundUp( Value.Divide([EndValue]-[StartValue],12) + [EndYear]-[StartYear] )
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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