Nested If

G

Guest

Hi There

I have another question:
Here is my dilemma:

If you look at the formula(s) below, you will notice that there are three
formulas.

Formulas for cost

1) Weight Rate =([totalweight]*0.055)
2) Cubic Feet Rate =([LTLsize]*0.35)
3) Less Than Load (LTL) Rate =charges([ltlsize])

Function for Storage Charge

=IIf(([totalweight]*0.055)>([ltlsize]*0.35),([totalweight]*0.055),
([ltlsize]*0.35))

What I need this formula to do is to choose the highest value of the three
formulas for cost. For example, if the 'weight rate' is $2.75 (5 lbs * .55),
and the Cubic Feet Rate is $3.50 (10 * .35), and the Less Than Load Rate is
$55 (default because the weight inputed is less than 50 pounds), then the
'Storage Charge' should display $55 multiplied Please noticed that right now,
the above Storage Charge formula is only making a comparison between two
values instead of three.

What I need is that if the Weight Rate is greater than the Cubic Feet Rate
and the Less Than Load (LTL) Rate, then the storage charge should be equal to
Weight rate. (I need ALL posibble combinations to cover all three formulas).

Thank you again to you all for helping me out!
 
D

Douglas J Steele

=IIf(([totalweight]*0.055)>([ltlsize]*0.35),IIf([totalweight]*0.055) >
charges([ltlsize]), [totalweight]*0.055, charges([ltlsize])),
([ltlsize]*0.35))
 
G

Guest

Dear Douglas

In this one, I get another error:
"The Expression you entered has a function containing the wrong number of
paramenters". Does it has anything to do with the comma and the another IIF?

Can you assist me, please?


Douglas J Steele said:
=IIf(([totalweight]*0.055)>([ltlsize]*0.35),IIf([totalweight]*0.055) >
charges([ltlsize]), [totalweight]*0.055, charges([ltlsize])),
([ltlsize]*0.35))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sandy said:
Hi There

I have another question:
Here is my dilemma:

If you look at the formula(s) below, you will notice that there are three
formulas.

Formulas for cost

1) Weight Rate =([totalweight]*0.055)
2) Cubic Feet Rate =([LTLsize]*0.35)
3) Less Than Load (LTL) Rate =charges([ltlsize])

Function for Storage Charge

=IIf(([totalweight]*0.055)>([ltlsize]*0.35),([totalweight]*0.055),
([ltlsize]*0.35))

What I need this formula to do is to choose the highest value of the three
formulas for cost. For example, if the 'weight rate' is $2.75 (5 lbs * ..55),
and the Cubic Feet Rate is $3.50 (10 * .35), and the Less Than Load Rate is
$55 (default because the weight inputed is less than 50 pounds), then the
'Storage Charge' should display $55 multiplied Please noticed that right now,
the above Storage Charge formula is only making a comparison between two
values instead of three.

What I need is that if the Weight Rate is greater than the Cubic Feet Rate
and the Less Than Load (LTL) Rate, then the storage charge should be equal to
Weight rate. (I need ALL posibble combinations to cover all three formulas).

Thank you again to you all for helping me out!
 
D

Douglas J Steele

Sorry, my fault. Incorrect count of parentheses. You need one more opening
parenthesis after the second IIf.

=IIf(([totalweight]*0.055)>([ltlsize]*0.35),IIf(([totalweight]*0.055) >
charges([ltlsize]), [totalweight]*0.055, charges([ltlsize])),
([ltlsize]*0.35))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sandy said:
Dear Douglas

In this one, I get another error:
"The Expression you entered has a function containing the wrong number of
paramenters". Does it has anything to do with the comma and the another IIF?

Can you assist me, please?


Douglas J Steele said:
=IIf(([totalweight]*0.055)>([ltlsize]*0.35),IIf([totalweight]*0.055) >
charges([ltlsize]), [totalweight]*0.055, charges([ltlsize])),
([ltlsize]*0.35))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sandy said:
Hi There

I have another question:
Here is my dilemma:

If you look at the formula(s) below, you will notice that there are three
formulas.

Formulas for cost

1) Weight Rate =([totalweight]*0.055)
2) Cubic Feet Rate =([LTLsize]*0.35)
3) Less Than Load (LTL) Rate =charges([ltlsize])

Function for Storage Charge

=IIf(([totalweight]*0.055)>([ltlsize]*0.35),([totalweight]*0.055),
([ltlsize]*0.35))

What I need this formula to do is to choose the highest value of the three
formulas for cost. For example, if the 'weight rate' is $2.75 (5 lbs * ..55),
and the Cubic Feet Rate is $3.50 (10 * .35), and the Less Than Load
Rate
is
$55 (default because the weight inputed is less than 50 pounds), then the
'Storage Charge' should display $55 multiplied Please noticed that
right
now,
the above Storage Charge formula is only making a comparison between two
values instead of three.

What I need is that if the Weight Rate is greater than the Cubic Feet Rate
and the Less Than Load (LTL) Rate, then the storage charge should be
equal
to
Weight rate. (I need ALL posibble combinations to cover all three formulas).

Thank you again to you all for helping me out!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top