If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > IIF i could understand this

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-25-07, 15:00
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
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])
Reply With Quote
  #2 (permalink)  
Old 10-25-07, 15:24
shades shades is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 10-25-07, 15:49
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
this is in access but im translating to vba used and others are variables

i am trying to just create the nested if statement
Reply With Quote
  #4 (permalink)  
Old 10-25-07, 16:33
shades shades is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 11-01-07, 16:41
norie norie is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 11-01-07, 18:24
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On