Home > Software engineering >  How can I make an IF Formula that depending on the number it will use Floor.Math or it wil use Ceili
How can I make an IF Formula that depending on the number it will use Floor.Math or it wil use Ceili

Time:01-10

I want to have comercial prices ending in 90, For example:

  • $3.945 = $3.890 ---> floor.math($3.945, 1000) - 10
  • $3.955 = $3.990 ---> ceiling.math($3.955, 1000) - 10

So I want to make an IF that when $x.x5x it uses ceiling.math (5 and up) but when it is $x.x4x it uses floor.math (4 and down)

Also when its $xx.x5x it uses ceiling.math (5 and up) and when its $xx.x4x it uses floor.math (4 and down)

¿Any ideas?

CodePudding user response:

I think rounding price to 1 decimal and then substracting 0.01 should do the trick. Formula: =ROUND(A1,1)-0.01

Result:

enter image description here

CodePudding user response:

The formula for this is:

=Round(Price,-1)

Example:

  • 32.256 --> 32.260
  • 32.249 --> 32.250
=Round(Price,-2)

Example:

  • 32.251 --> 32.300
  • 32.249 --> 32.200
=Round(Price,-3)

Example:

  • 32.251 --> 33.000
  • 32.249 --> 32.000
  • Related