Avatar of mato01
mato01
Flag for United States of America asked on

IIF Statement

Having trouble with the following statement.

What I'm trying to get is that if Southern Brand = Florida, or Southern Brand = Georgia give me etc.


VOLUME PCT:IIF([tbl_SumofValues].[Southern Brand]="Florida" and [tbl_SumofValues].[Southern Brand]="Georgia),"[Format([Volume]/[SumofVolume]*100,"#,##0.000000000)/6]","[Format([Volume]/[SumofVolume]*100,"#,##0.000000000(Format([Volume]/[SumofVolume]*100,"#,##0.000000000])"
Microsoft Applications

Avatar of undefined
Last Comment
mato01

8/22/2022 - Mon
tomHamill

I'm not sure if this is a typo in your question or if that code snip is what you're actually using, but the code you've provided uses "AND" when your question says you're looking for "OR."

The formula in your question will only do the calculation if the SouthernBrand field equals both Florida and Georgia.  I assume that will never happen.

Anyway, try replacing the AND with OR.  You could also use nested if statements like

=IF([SouthernBrand] = "Flordia", Calculate,
     IF([SouthernBrand]="Georgia", Calculate, do whatever you need to do for other states))

Tom
mato01

ASKER
Okay, I'm trying to use the Nested Statements, but still getting an syntax error.  

VOLUME PCT: IIf([tbl_SumofValues].[Southern Brand]="Florida",
Format([Volume]/[SumofVolume]/6*100,
IIf([tbl_SumofValues].[Southern Brand]="Georgia",
Format([Volume]/[SumofVolume]/6*100,
“Format([Volume]/[SumofVolume]*100")))
ASKER CERTIFIED SOLUTION
tomHamill

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mato01

ASKER
Thanks for the lecture.  I do need to be more careful on how i format my questions.  It's all a learning process for me.

Works perfectly.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck