Thanks:  0
Likes:  0

# Thread: Having trouble with =IF formula

1. ## Having trouble with =IF formula

Hello All,
Would like to see if someone can help me with the following issue:

I am comparing the information typed into cells D61, 62, 63, 64, 65 to the static information in cells C61, 62, 63, 64, 65.

This is how the static information appears in the C cells:
C61 has 2:00
C62 has 3:00
C63 has 4:00
C64 has 8:30
C65 has 10:30

I used =IF(D61<=C61,"YES","NO") in the equivalent E cells and copied it down to E65 so if the manually entered info in the D cells was equal to or less than the C cells I would get YES and if it was greater than I would get a NO.

Works perfectly on all except when comparing D65 to C65. As long as anything between 10:00 and 10:30 is entered I get a YES but if anything else is entered I get a NO even when it is less than 10:30. All info is formatted as text.

2. ## Re: Having trouble with =IF formula

Sorry, that last sentence should read I get a NO even when anything less than 10:00 is entered. Again, 10:00 to 10:30 returns YES. From 9:59 back and 10:31 forward returns NO.

3. ## Re: Having trouble with =IF formula

Are you sure that you formulas ask for <= instead = only?

Take a look at your formula again.

I hope it helps.

4. ## Re: Having trouble with =IF formula

Originally Posted by Marcílio_Lobão

Are you sure that you formulas ask for <= instead = only?

Take a look at your formula again.

I hope it helps.
Yes I believe they do. All five formulas are the same =IF(D""<=C"","YES","NO")

All work as they should except for E65 comparing D65 and C65.

5. ## Re: Having trouble with =IF formula

Hi,

The problem is, you said All info is formatted as Text, comparing Text with the > >= < <= expressions are Not going to work correctly.

6. ## Re: Having trouble with =IF formula

"...All info is formatted as text...."
Perhaps the question is due to this fact.

Do all cells in column C and column D have the same format?

So we can check what is happening.

I hope it helps.

7. ## Re: Having trouble with =IF formula

Originally Posted by jtakw
Hi,

The problem is, you said All info is formatted as Text, comparing Text with the > >= < <= expressions are Not going to work correctly.
I'm a little slow with formulas so bear with me.......how does the formula work with the other four cells when all five are all formatted the same?

8. ## Re: Having trouble with =IF formula

Originally Posted by Marcílio_Lobão

"...All info is formatted as text...."
Perhaps the question is due to this fact.

Do all cells in column C and column D have the same format?

So we can check what is happening.

I hope it helps.
I would love to do that but unfortunately the spreadsheet contains company information that is sensitive and can't be shared or altered.

9. ## Re: Having trouble with =IF formula

I'm a little slow with formulas so bear with me.......how does the formula work with the other four cells when all five are all formatted the same?
Hit and Miss. It didn't actually "Work", it just so happens it yielded the result you wanted by Luck.

Basically, it's like =IF("THIS"<="THAT","YES","NO")

10. ## Re: Having trouble with =IF formula

So what would be the best formula to get the desired results on for all cells?