Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
kevin
 
Posts: n/a
Default 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   Report Post  
Kevin H. Stecyk
 
Posts: n/a
Default

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   Report Post  
kevin
 
Posts: n/a
Default

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   Report Post  
Kevin H. Stecyk
 
Posts: n/a
Default

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

Thanks Kevin


My pleasure.

Regards,
Kevin


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Statement with Average Function results in #Value! Paul Excel Discussion (Misc queries) 5 December 28th 04 08:11 AM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM
Statement lintan Excel Worksheet Functions 1 December 2nd 04 11:31 PM
Duplicate fields does not match up! If statement Patsy Excel Worksheet Functions 0 November 11th 04 12:16 AM
If statement needed Patsy Excel Worksheet Functions 1 November 4th 04 03:48 PM


All times are GMT +1. The time now is 04:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"