Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Round Up Calculated Total of Revit Schedule Cell

31 REPLIES 31
SOLVED
Reply
Message 1 of 32
rvtquestions
26301 Views, 31 Replies

Round Up Calculated Total of Revit Schedule Cell

I need help rounding up the Calculated Total of a cell within a column of a Revit Schedule. As an example, I have a schedule with (4) parameters: "Count", "Value","Denom","Result". Count being the number of elements, Value being some value associated to the element, Denom being the Denominator Value is to be divided by, and Result being the Result. All columns shown in grey have the "Calculate Totals checked" and thus show the combined total for each type.

 Schedule.png

 

 

For column "Result" it is a calculated value as a "Number" with a formula "Value/Denom" at a Field Format of 2 decimal places.

cv1.png

 

My issue is rounding up these values to the nearest whole number. I cannot simply change the "Result" calculated value to "roundup(Value/Denom)" as it would result incorrectly or even null

cv2.png

for example, the first row of Result of type count 5 is really the sum of (3/24 = 0.13) 5 times or 0.65.

0.13

0.13

0.13

0.13

0.13

 

if I used the roundup function it would result in, resulting in a total of 5.

1

1

1

1

1

The desired outcome being the next whole number of 0.65 = 1.

 

Any idea how to go about this? Thank you.

31 REPLIES 31
Message 2 of 32
barthbradley
in reply to: rvtquestions

How about changing precision of value returned through the FORMAT tab? 

Message 3 of 32
rvtquestions
in reply to: barthbradley

Hey @barthbradley

I already have "Result" set to a Field Format of 2 decimal places. if I change it to 0 or higher it will return odd values but most likely 0.

Message 4 of 32
ToanDN
in reply to: rvtquestions

Can you share the file you are working on so that we don't have to recreate it?

Toan Nguyen
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 5 of 32
barthbradley
in reply to: rvtquestions

Wouldn't you need another calculated field to do the rounding of the exact total value returned in Results. In other words, no roundup in the Value/Denom calculated parameter.  Or maybe I'm misreading what you want to do.  

Message 6 of 32
barthbradley
in reply to: rvtquestions

Whatever.pngWhatever 2.png

Message 7 of 32
rvtquestions
in reply to: barthbradley

Hey @barthbradley I appreciate your help. Thank you for your response. From the looks of what you have it seems to be right. Just so we are on the same page, in your example there are (5) elements that each have a "Value" parameter of "3"? If you checked Itemize all instances, what does it show in Result for each cell? It should be 0.125. Not sure about RoundupResults that is what I am trying to avoid. To reiterate (if itemize all instances was checked) it should be (5) rows of:

 

[Value][Denom][Result]

[    3    ][    24    ][  0.125 ]

 

which adds up to 0.625, which I'd like to round to the next whole number being 1.

So if instead value was 7, each result would end up being 0.30 depending on the rounding and add up to 1.5 and result as 2.

Message 8 of 32
barthbradley
in reply to: rvtquestions

Whatever 4.png

 

 

Or do you mean like this?

 

 

Whatever 5.png

Message 9 of 32
rvtquestions
in reply to: barthbradley

Looks promising so far the first Desired Result is what I am aiming for. Not sure if this makes a difference but the numbers I end up with aren't always as neat as .125 or .25 they can vary from 0.008 to 0.1, etc. But anyways yes Desired Result #1 is what I am after.

Message 10 of 32
barthbradley
in reply to: rvtquestions

Well, you can play with values, but the "Desired Results" column is achieved by formatting Parameter to change its Field Format Units (Fixed and 0) and Calculate Totals.  No roundup in formula. Just Value/Denom.  

Message 11 of 32
rvtquestions
in reply to: barthbradley

Hi @barthbradley

 

Yes I've tried playing around with the tolerances, from Setting multiple decimal places to 0 to even nearest 10th. The closest solution is in fact 0 decimal places; however, the tricky situation as I will reiterate is that I would like to roundup the total result, not just round. Difference being if the sum result was 0.4 I would still like it to be 1 and not 0.

 

My current thought is to maybe have one raw Result column, one Result column that is rounded, and one Result column be the difference between the two with a condition:

 

(if r2-r1<0.5, some added factor, else r2)

 

[   r1  ][  r2 ][  r3  ]

[0.44][  0  ][   1    ]

Message 12 of 32
Anonymous
in reply to: rvtquestions

You will need to create two different calculated columns to do some math...

1) First go to the Formatting tab for the Result column and change the drop down under Field formatting: to Calculated totals

2) create a calculated parameter (result%) that is the percentage of the results column by the <Grand total>, again go to the formatting tab and under the Field Format... change Units: to "General" .

3)create a calculated parameter Type: Number and under Formula: roundup(result%). this should then give you the rounded up number of the grand total of your base result column.

Capture.PNG

you can then hide the first result column and the % column. and un-check itemize every instance and get the following...Capture2.PNG

Message 13 of 32
Anonymous
in reply to: Anonymous

edit formula...

 

3)create a calculated parameter Type: Number and under Formula: roundup(Result/result%)

Message 14 of 32
rvtquestions
in reply to: Anonymous

@Anonymous

 

Thank you for your reply and great workaround. However, I believe this would only work for a single grand total right? In your example it assumes there is only one type that is being calculated. It would need to work off the total per combined cell. For example if there was another type added to the schedule say:

 

[ Result ][ Result% ][ Result (Round Up) ]

TYPE 1

[    0.16  ][ 0.3333    ][ 1                                ]

[    0.16  ][ 0.3333    ][ 1                                ]

[    0.16  ][ 0.3333    ][ 1                                ]

TYPE 2

[    1.25  ][ 0.5          ][ 3  (should be 2)       ]

[    1.25  ][ 0.5          ][ 3  (should be 2)       ]

 I would need the 0.16 type to work independently of the 0.25 type. In your example it would turn out like this:

 

[ Result ][ Result% ][ Result (Round Up) ]

TYPE 1

[    0.16  ][ 0.0537    ][ 3 (should be 1)       ]

[    0.16  ][ 0.0537    ][ 3 (should be 1)       ]

[    0.16  ][ 0.0537    ][ 3 (should be 1)       ]

TYPE 2

[    1.25  ][ 0.419          ][ 3 (should be 2)       ]

[    1.25  ][ 0.419          ][ 3 (should be 2)       ]

 

 

Message 15 of 32
Anonymous
in reply to: rvtquestions

It should still work as long as you have your Sorting/Grouping established correctly. Could you send me your file so I can try implementing it?

Message 16 of 32
rvtquestions
in reply to: Anonymous

Unfortunately not near the actual document at the moment and working hypothetically. However, in your example schedule a family with different types such as Type 1 and Type 2. Type 1 holding a value parameter, ideally all with different values that get calculated totals checked. Same thing for Type 2. Then sort by Type.

 

I literally made a quick example using furniture of 2 types. the calculated Value is being divided by 12 in Result.

Schedule.png

Message 17 of 32
Anonymous
in reply to: rvtquestions

You were correct, the method I suggested did not work. However after replicating your schedule I think I may have come up with a solution. Its not a pretty formula but I think it works. I still created a (result%) based off of the Result column only instead of it being <calculated total> I selected <Type>. Then I created a calculated Parameter "Rounded Result" with the Formula: (roundup(Result / result%)) / ((Result / result%) / Result)

see images below... as long as the Rounded Result column has calculated totals checked under Field Formatting: it works. Also I removed any field formatting for rounding decimals from the "Result" parameter. Capture.PNGCapture2.PNGCapture3.PNG

Message 18 of 32
rvtquestions
in reply to: Anonymous

Thank you @Anonymous

 

Seems to be working!

Message 19 of 32
asadkamalabbasi
in reply to: Anonymous

Thank you brother. It worked like a charm.

Message 20 of 32
Anonymous
in reply to: Anonymous

What value is <TYPE> referring to in your formula?

I have a similar case with a parking calculation chart and need to round up the results.

jquipildor_0-1590175695894.png

Thank you,

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Technology Administrators