IIf Statements

G

Guest

I am currently using the following IIF statement- if ConditionA is met, a
value of 750 is returned, otherwise 0 is returned:

IIf([ConditionA]=true,750,0)

I would like to amend this statement so that if Condition A is true, then
the greater of 750 or .0125*[AmountA] is returned. A value of 0 would still
be returned if Condition A is not true.

What should my IIF statement look like to achieve this?

Many thanks
 
G

Guest

RickJ:

While I haven't ever used/tried this, my first effort would be a nested IIF
statement, like this:

IIf([ConditionA]=true,iif(([ConditionA]*.0125)>750,([ConditionA*.0125),750),0)

HTH.

Sharkbyte
 
F

fredg

I am currently using the following IIF statement- if ConditionA is met, a
value of 750 is returned, otherwise 0 is returned:

IIf([ConditionA]=true,750,0)

I would like to amend this statement so that if Condition A is true, then
the greater of 750 or .0125*[AmountA] is returned. A value of 0 would still
be returned if Condition A is not true.

What should my IIF statement look like to achieve this?

Many thanks

I would reverse the logic.
=IIf(Not [ConditionA] = True,0, IIf(750> 0.0125*[AmountA],
750,0.0125*[AmountA]))
 
G

Guest

Works perfect- thanx for your expertise--

Sharkbyte said:
RickJ:

While I haven't ever used/tried this, my first effort would be a nested IIF
statement, like this:

IIf([ConditionA]=true,iif(([ConditionA]*.0125)>750,([ConditionA*.0125),750),0)

HTH.

Sharkbyte




RickJ said:
I am currently using the following IIF statement- if ConditionA is met, a
value of 750 is returned, otherwise 0 is returned:

IIf([ConditionA]=true,750,0)

I would like to amend this statement so that if Condition A is true, then
the greater of 750 or .0125*[AmountA] is returned. A value of 0 would still
be returned if Condition A is not true.

What should my IIF statement look like to achieve this?

Many thanks
 
G

Guest

Glad I could help. However, I just noticed that you may want to add an "="
in the nested IIF. To cover a situation of things being equal. The result
would look like this:

IIf([ConditionA]=true,iif(([ConditionA]*.0125)>=750,([ConditionA*.0125),750),0)


Sharkbyte




RickJ said:
Works perfect- thanx for your expertise--

Sharkbyte said:
RickJ:

While I haven't ever used/tried this, my first effort would be a nested IIF
statement, like this:

IIf([ConditionA]=true,iif(([ConditionA]*.0125)>750,([ConditionA*.0125),750),0)

HTH.

Sharkbyte




RickJ said:
I am currently using the following IIF statement- if ConditionA is met, a
value of 750 is returned, otherwise 0 is returned:

IIf([ConditionA]=true,750,0)

I would like to amend this statement so that if Condition A is true, then
the greater of 750 or .0125*[AmountA] is returned. A value of 0 would still
be returned if Condition A is not true.

What should my IIF statement look like to achieve this?

Many thanks
 

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