+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Conditional logic issue

  1. #1
    Registered User
    Join Date
    04-05-2011
    Location
    Boca Raton, FL
    MS-Off Ver
    Excel 2003
    Posts
    3

    Conditional logic issue

    I am trying to assign values based on the following scenario:
    If the value of a cell is >= "D24", then x. If false, then y. D24 is the value, not a reference to a particular cell. The formula I am using is:
    =IF(L3>="D24", "X","Y")
    Formula works fine for values D1 and D2, but D3-D9 return "X" instead of "Y". Values above D24 work fine. Suggestions?
    Last edited by NBVC; 04-05-2011 at 01:52 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,404

    Re: Conditional logic issue

    Since D24 is a text: How do you want to compare it with something?

    If it's a cell remo " " around it.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Conditional logic issue

    Are the values always starting with "D"?

    If so, then you can compare just the numeric portions.

    e.g.

    =IF(MID(L3,2,10)+0>=MID("D24",2,10)+0, "X","Y")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    04-05-2011
    Location
    Boca Raton, FL
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Conditional logic issue

    Quote Originally Posted by zbor View Post
    Since D24 is a text: How do you want to compare it with something?

    If it's a cell remo " " around it.
    I've tried it as a number, as general, as text. results same in every instance.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,404

    Re: Conditional logic issue

    Can you upload example workbook with your input and expected result.

  6. #6
    Registered User
    Join Date
    04-05-2011
    Location
    Boca Raton, FL
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Conditional logic issue

    Quote Originally Posted by NBVC View Post
    Are the values always starting with "D"?

    If so, then you can compare just the numeric portions.

    e.g.

    =IF(MID(L3,2,10)+0>=MID("D24",2,10)+0, "X","Y")
    THANK YOU!!!
    Used the following:
    =IF(MID(L3,2,2)+0>24, "X","Y"
    Worked great!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Conditional logic issue

    Yes, if you know it is 24 always, that is better... my sample was more for showing that you can also replace D24 with another cell reference that may change....

+ 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.6.0 RC 1