Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: IIF i could understand this

    can someone help me create a nest if than statement out of this IIF, im having big difficulties

    IIf([Int]="I",IIf([used]="1" Or [used]="2" Or [used]="3" Or [used]="A" Or [used]="B" Or [used]="C",IIf([tat]="ment","A",IIf([Qa],"33",IIf([used]="1","1","2")
    )),[used]),[used]) AS PM, IIf([tat]="ment" And [PM]="a" And [used]<>"C",[used],[Pm]) AS [Fm], IIf([playing]="No","*",[FM])

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    That is not an Excel expression. IIF is for Access, IF is the formula in Excel. But you have to give us a little more on what [used], etc. mean, refer to.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Oct 2003
    Posts
    233
    this is in access but im translating to vba used and others are variables

    i am trying to just create the nested if statement

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    Since this is the Excel sub-forum, I was confused. Comes naturally at my age.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  5. #5
    Join Date
    Mar 2006
    Posts
    163
    What is that statement actually meant to do?

    By the way I would strongly recommend you don't use Int as a field name or a variable in VBA, it's a VBA function.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Before translating into Excel, try and simplify the badger into pseduo code. Basically, explain what you want to achieve as simple as possible.

    For example
    Code:
    If [used] = 1 Then
      result = "1"
    Otherwise
      result = "2"
    End
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •