+ Reply to Thread
Results 1 to 4 of 4

Thread: Can there be a third choice in an IF statement?

  1. #1
    kevin
    Guest

    Can there be a third choice in an IF statement?

    Good day: I am using the following formula to make choices for conditional
    formatting in other cells. As it is, the "else" would be the result of an
    entry of a US state abbreviation and would result in a 2 being placed in the
    cell. The problem is that if the source cell is blank a 2 is returned. Is
    there another way of expressing this so that a Canadian province abb =1, a US
    state = 2 and a blank cell ="" null.
    =IF(OR(C6={"NB","NS","NF","NL","PE","PQ","QE","ON","MB","SK","AB","BC"}),1,2)
    --
    Thanks Kevin

  2. #2
    Kevin H. Stecyk
    Guest

    Re: Can there be a third choice in an IF statement?

    kevin wrote...
    > Good day: I am using the following formula to make choices for conditional
    > formatting in other cells. As it is, the "else" would be the result of an
    > entry of a US state abbreviation and would result in a 2 being placed in
    > the
    > cell. The problem is that if the source cell is blank a 2 is returned. Is
    > there another way of expressing this so that a Canadian province abb =1, a
    > US
    > state = 2 and a blank cell ="" null.
    > =IF(OR(C6={"NB","NS","NF","NL","PE","PQ","QE","ON","MB","SK","AB","BC"}),1,2)
    > --


    Hi,

    I think you are looking for this:

    =IF(ISBLANK(C6), "",
    IF(C6={"NB","NS","NF","NL","PE","PQ","QE","ON","MB","SK","AB","BC"},1,2))

    (watch the line wrap),

    Blank...""
    Cdn...1
    US...2

    HTH

    Regards,
    Kevin



  3. #3
    kevin
    Guest

    Re: Can there be a third choice in an IF statement?

    Thanks very much Kevin this is exactly what i needed.

    Thanks Kevin

    "Kevin H. Stecyk" wrote:

    > kevin wrote...
    > > Good day: I am using the following formula to make choices for conditional
    > > formatting in other cells. As it is, the "else" would be the result of an
    > > entry of a US state abbreviation and would result in a 2 being placed in
    > > the
    > > cell. The problem is that if the source cell is blank a 2 is returned. Is
    > > there another way of expressing this so that a Canadian province abb =1, a
    > > US
    > > state = 2 and a blank cell ="" null.
    > > =IF(OR(C6={"NB","NS","NF","NL","PE","PQ","QE","ON","MB","SK","AB","BC"}),1,2)
    > > --

    >
    > Hi,
    >
    > I think you are looking for this:
    >
    > =IF(ISBLANK(C6), "",
    > IF(C6={"NB","NS","NF","NL","PE","PQ","QE","ON","MB","SK","AB","BC"},1,2))
    >
    > (watch the line wrap),
    >
    > Blank...""
    > Cdn...1
    > US...2
    >
    > HTH
    >
    > Regards,
    > Kevin
    >
    >
    >


  4. #4
    Kevin H. Stecyk
    Guest

    Re: Can there be a third choice in an IF statement?

    kevin wrote...
    > Thanks very much Kevin this is exactly what i needed.
    >
    > Thanks Kevin


    My pleasure.

    Regards,
    Kevin



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0