IIfmultiple conditions (1 Viewer)

aattas

Registered User.
Local time
Today, 12:12
Joined
Dec 24, 2014
Messages
74
Experts,
need help here.

I tried to do a multilple IIF, but the results always come out on the first one, how can i tie the conditions and each should act accordingly. Here is the code.

=IIf([First of Codecat]=1,[AccessTotalsmuamaladate_By_Month]*0.25,[calculate]), IIf([First of Codecat]=2,[AccessTotalsmuamaladate_By_Month]*1,[calculate]),IIf([First of Codecat]=3,[AccessTotalsmuamaladate_By_Month]*2,[calculate])

System only recognize the first condition. Appreciate your help and thankyou in advance.
 

essaytee

Need a good one-liner.
Local time
Today, 20:12
Joined
Oct 20, 2008
Messages
512
Firstly check out the docs here.


From the docs here is a sample nested iif statement.
Code:
=IIf([CountryRegion]="Italy", "Italian", IIf([CountryRegion]="France",  "French", IIf([CountryRegion]="Germany", "German", "Some other  language")))
You'll note the nested iff's are a part of the false conditions, whereas your sample it's not.


Does that clear it up.
 

isladogs

MVP / VIP
Local time
Today, 09:12
Joined
Jan 14, 2017
Messages
18,186
Move the two right brackets ) from the middle of your expression to the end
 

aattas

Registered User.
Local time
Today, 12:12
Joined
Dec 24, 2014
Messages
74
Experts,

I have solved my problem,

With this
=IIf([First of Codecat]=2,[AccessTotalsmuamaladate_By_Month]*1,IIf([First of Codecat]=1,[AccessTotalsmuamaladate_By_Month]*0.25,IIf([First of Codecat]=3,[AccessTotalsmuamaladate_By_Month]*2)))
 

essaytee

Need a good one-liner.
Local time
Today, 20:12
Joined
Oct 20, 2008
Messages
512
Experts,

I have solved my problem,

With this
=IIf([First of Codecat]=2,[AccessTotalsmuamaladate_By_Month]*1,IIf([First of Codecat]=1,[AccessTotalsmuamaladate_By_Month]*0.25,IIf([First of Codecat]=3,[AccessTotalsmuamaladate_By_Month]*2)))


Glad you got it sorted, but I am not an expert.
 

sonic8

AWF VIP
Local time
Today, 10:12
Joined
Oct 27, 2015
Messages
998
Experts,
I tried to do a multilple IIF, but the results always come out on the first one, how can i tie the conditions and each should act accordingly. Here is the code.
I noted that you solved the problem already. Still I'd like to mention my video on the Iif and Switch functions which covers that topic and might show an alternative to the nested Iif-statements.
 

Users who are viewing this thread

Top Bottom