# Excel 2007 : Conditional logic issue

1. ## 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?

2. ## 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. ## 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")

4. ## Re: Conditional logic issue

Originally Posted by zbor
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.

6. ## Re: Conditional logic issue

Originally Posted by NBVC
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. ## 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....

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

#### 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