Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2004
    Location
    Indiana, Venezuela
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Other way than IF? (Excel 2003)

    I'm trying to build code that will allow me to pull data from one sheet to another based on 1 of 20 possible areas. (Lineups for a fantasy sports league) I'm running into the problem of a limited # of IF arguments you can put into one statement (6-7, I think).

    Ideas?

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Other way than IF? (Excel 2003)

    The limit is 7. It would help to know more detail. See if =CHOOSE(argument,return1,return2,return3,etc) might work for you.

    Or you could use VBA to build a UDF using Select Case.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Other way than IF? (Excel 2003)

    If the output is to be numerics, you don't need an IF test as such. For example:
    =(A1="Fred")*20+(A1="Bob")*13.5+(A1<>"Joe")*3

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Other way than IF? (Excel 2003)

    Here is a nice summary by John Walkenback of various ways around a nested if (some already suggested).

    If none of these work, you could provide a few more details and we can try to help further.

    Steve

Posting Permissions

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