Skip to main content

If (field name) is multiple of 4, Round up?

  • July 12, 2019
  • 8 replies
  • 61 views

Forum|alt.badge.img+11

Hi again,
Trying to write an IF statement for a cost catagory.
This is what I have now.

{12" GH} * 25.0

BUT I would like it to say:

IF ({12" GH} is a multiple of 4, * 125, (Roundup ({12" GH}) * 25)))

If the field is NOT a multiple of 4, I’d like it to round UP the field to the nearest whole integer.

How would I write that?

Thank you!

8 replies

JonathanBowen
Forum|alt.badge.img+18

Hi @Lisa_H - try this:

IF(MOD({12" GH}, 4) = 0, {12" GH} * 0.25, ROUNDUP({12" GH}, 0) * 0.25)

But looking at the results of this, it seems to me the “multiple of 4” is redundant, you get the same results with just:

ROUNDUP({12" GH}, 0) * 0.25

Have I understood the problem correctly?

JB


Forum|alt.badge.img+11
  • Author
  • Known Participant
  • July 12, 2019

Hi @Lisa_H - try this:

IF(MOD({12" GH}, 4) = 0, {12" GH} * 0.25, ROUNDUP({12" GH}, 0) * 0.25)

But looking at the results of this, it seems to me the “multiple of 4” is redundant, you get the same results with just:

ROUNDUP({12" GH}, 0) * 0.25

Have I understood the problem correctly?

JB


I’m not sure… The 12" GH column will be Total number of Linear feet of job. And each panel is 4’ long. So I need the Roundup column to round it up . So say there is 25’ in the 12" column. I need 7 to appear in the Round up column for it to work.


Forum|alt.badge.img+11
  • Author
  • Known Participant
  • July 12, 2019

this is what I have now – The how many to order shows 13… BUT its calculating by the hidden 12.5 instead of 13 * 125


JonathanBowen
Forum|alt.badge.img+18

this is what I have now – The how many to order shows 13… BUT its calculating by the hidden 12.5 instead of 13 * 125


Ah OK, think you need this:

ROUNDUP({12" GH}/4, 0)


Forum|alt.badge.img+11
  • Author
  • Known Participant
  • July 12, 2019

So I need 4 columns to get it done? I was actually hoping for 3… ? no way to get it to round up to the next integer instead of .88?


JonathanBowen
Forum|alt.badge.img+18

So I need 4 columns to get it done? I was actually hoping for 3… ? no way to get it to round up to the next integer instead of .88?


You don’t need the “Div/4” and “Roundup Div/4” columns - these were just for illustration. The formula column is the formula shown above, which encapsulates it all.


JonathanBowen
Forum|alt.badge.img+18

So you should end up with this:


Forum|alt.badge.img+11
  • Author
  • Known Participant
  • July 12, 2019

OHHH ok Gotcha!! I was trying to /4 after the , instead of before :grinning_face_with_big_eyes:

Thank you! It works now!