Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    361

    Unanswered: Function problem

    Here is the function I have so far.

    =IIf([Model #]="996610S" And [Year]="2001" Or "996610T" And [Year]="2001","56000",(IIf([Model #]="996410T" And [Year]="2001" Or "996410S" And [Year]="2001",51000,IIf([Model #]="996310S" And [Year]="2001" Or "996310T" And [Year]="2001",52000,IIf([Model #]="996110T" And [Year]="2001" Or "996110S" And [Year]="2001",47000,IIf([Model #]="986320S" And [Year]="2001" Or "986320T" And [Year]="2001",30300,IIf([Model #]="986310T" And [Year]="2001" And [Year]="2001" Or "986310S" And [Year]="2001",26900,"0")))))))

    Unfortunatly the only number that is returned is 56000 reguard less of the value that is in in Model #. IT never sees the rest of the function. What do you suggest?

  2. #2
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    I just made a table and entered your model numbers and also 2001 for every records.

    Pasted your IIf into a calculated field and like you got 56000 for every record.

    Put [Model #]= after your "or" as in

    IIf([Model #]="996610S" And [Year]="2001" Or [Model #]="996610T" And [Year]="2001","56000",(IIf([Model #]="996410T" And [Year]="2001" Or [Model #]="996410S" And [Year]="2001",51000,IIf([Model #]="996310S" And [Year]="2001" Or [Model #]="996310T" And [Year]="2001",52000,IIf([Model #]="996110T" And [Year]="2001" Or [Model #]="996110S" And [Year]="2001",47000,IIf([Model #]="986320S" And [Year]="2001" Or [Model #]="986320T" And [Year]="2001",30300,IIf([Model #]="986310T" And [Year]="2001" And [Year]="2001" Or [Model #]="986310S" And [Year]="2001",26900,"0")))))))

    That gave me the following results

    Year Model # Test1
    2001 996610S 56000
    2001 996610T 56000
    2001 996410T 51000
    2001 996410S 51000
    2001 996310S 52000
    2001 996310T 52000
    2001 996110T 47000
    2001 996110S 47000
    2001 986320S 30300
    2001 986320T 30300
    2001 986310T 26900
    2001 986310S 26900

  3. #3
    Join Date
    Mar 2004
    Posts
    361
    Great thanks. Friday afternoon and I can't read code anymore. Thanks again.

Posting Permissions

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