• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

IIf statment with two variables

I am trying to get this to work but it always shows NO

=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR" OR "NIKON COOLPIX 3 YEAR WARR","YES","NO")

Thanks for the help!
Ward
0
camco
Asked:
camco
  • 7
  • 4
  • 3
  • +2
1 Solution
 
med39Commented:
Ward,

Try:
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR" OR [Text17] = "NIKON COOLPIX 3 YEAR WARR","YES","NO")
0
 
Harisha M GCommented:
Hi camco,
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR" OR [text17] ="NIKON COOLPIX 3 YEAR WARR","YES","NO")


Bye
---
Harish
0
 
Harisha M GCommented:
med39,
    You are very fast !!

camco,
    You can use "And", "Or" and "Not" operators to logically join more than one conditions :)
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
Arthur_WoodCommented:
could also be done like this:

=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR", "YES",IIF([Text17] = "NIKON COOLPIX 3 YEAR WARR","YES","NO"))

using nested IIF() function calls.

AW
0
 
EricJamesOlsonCommented:
how about using a string compare function instead.  

IIF((StrComp([Text17],"NIKON COOLPIX 2 YEAR WARR") = 0) OR (StrComp([Text17],"NIKON COOLPIX 3 YEAR WARR") = 0),"YES,"NO")

and another suggestion, use the entire Text17 name, referencing forms collection and form name,   (ie. [Forms]![frmMyFORM]![Text17])  
0
 
camcoAuthor Commented:
Wow that was fast! Thanks for the help.

Ward
0
 
Harisha M GCommented:
camco, you should have selected the first comment as the answer or should have split the points
0
 
med39Commented:
Harish,

Thanks for your fairness.  I appreciate it.

-med39
0
 
Harisha M GCommented:
Or did you select mine as the answer because of the next comment?
0
 
Harisha M GCommented:
med39, please post a question in CS to select your comment as the answer or to split.
0
 
camcoAuthor Commented:
I just screwed up. Sorry!

Ward
0
 
med39Commented:
Harish,

Re: "please post a question in CS to select your comment as the answer or to split".  I don't know what this means.

-m
0
 
Harisha M GCommented:
0
 
med39Commented:
Harish,

Thanks again.  You have my respect.

-m
0
 
camcoAuthor Commented:
Sorry that I caused so much trouble.

Ward
0
 
Harisha M GCommented:
Thanks Lunchy,

Cheers med39!
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 7
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now