Skip to main content
Question

Novice in need of help with rental rate formula

  • July 22, 2018
  • 0 replies
  • 127 views

Forum|alt.badge.img+8
Greetings:

I am a novice that is trying to calculate rental rates with price points based on duration of rentals.

@ four days discount, etc.  These individual statements work, but the series does not.
I get an error indicator about random characters at the end of the first line.

If I just use first line, it works great (for rentals of .5 day duration only).


If([Rental Days]=0.5,[Rental Days]*[Rental Item - Daily Rate],0)
If([Rental Days]>=1 or [Rental Days]<=3, [Rental Days]*[Rental Item - Daily Rate],0)
If([Rental Days]>=4 or [Rental Days]<=24, [Rental Days]*[Rental Item - Weekly Rate],0)
If([Rental Days]>=25, [Rental Days]*[Rental Item - Monthly Rate],0)


Any kindly assist would be greatly appreciated.

Try this

If(
[Rental Days]=0.5,[Rental Days]*[Rental Item - Daily Rate],

[Rental Days]>=1 or [Rental Days]=4 or [Rental Days]=25, [Rental Days]*[Rental Item - Monthly Rate])

  • Registered
  • July 22, 2018
You need to divide the range of min and max days into disjoint non-overlapping intervals that covers all possibilities.

Try this:

[Rental Days]
*
If(
                          [Rental Days] <=  3, [Rental Item - Daily Rate],
   3 < [Rental Days]  and [Rental Days] <= 24, [Rental Item - Weekly Rate],
  24 < [Rental Days]                         , [Rental Item - Monthly Rate]
)

  • Registered
  • July 22, 2018
Better yet:

[Rental Days]
*
If(
  [Rental Days] <=  3, [Rental Item - Daily Rate],
  [Rental Days] <= 24, [Rental Item - Weekly Rate],
  [Rental Item - Monthly Rate]
)

Forum|alt.badge.img+8
  • Author
  • Registered
  • July 22, 2018
Dan:

Excellent. I really appreciate you taking the time.
I think I need to use the ranges indicated below for correct pricing.  Is my use of "AND" correct?


[Rental Days]
*
If(
  [Rental Days] =.5,   [Rental Item - Daily Rate], 
  [Rental Days] >=1 AND <=  3, [Rental Item - Daily Rate],
  [Rental Days] >=4 AND <= 24, [Rental Item - Weekly Rate],
  [Rental Days] >24,[Rental Item - Monthly Rate]
)

Forum|alt.badge.img+8
  • Author
  • Registered
  • July 22, 2018
Dan:

Got it!  "AND" operator doesn't work.  The information you provided worked just fine  (just a couple more similar lines to create the ranges).

Thank you!  Was getting frustrated.

Dirk

Forum|alt.badge.img+8
  • Author
  • Registered
  • July 25, 2018
Thank you all for great help.

I think I am very close.

I am getting a error message: "Expecting number"

Did a screen grab (please see attached).

Any help is greatly appreciated.

Dirk

  • Registered
  • July 25, 2018
Syntax error. Remove the comma before the AND.

Forum|alt.badge.img+8
  • Author
  • Registered
  • July 25, 2018
Rob:

That was it.  It works just fine now.

Thank you for helping a beginner!

Dirk