1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ternary Operator Help

Discussion in 'C' started by pradeep, Sep 28, 2007.

  1. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Can anyone help me write this Excel formula in C/C++
    Code:
    =IF(C3>300000;IF(C3>600000;IF(C3>900000;IF(C3>1200000;IF(C3>1800000;IF(C3>2399999;300000);210000);90000);60000);45000);0)
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    My Excel says its an invalid one.
     
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    It's a valid one, cause I used it on an Excel sheet, btw i have solved it,
    Code:
    (iCtc>300000)?(iCtc>600000)?(iCtc>900000)?(iCtc>1200000)?(iCtc>1800000)?(iCtc>2399999)?300000:0:210000:90000:60000:45000:0;
    
     

Share This Page