# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  IF STATEMENT returns False, even though the results are true

## Biolu527

I was given the responsibility of tracking vacation time accrual when I started this position.  Since there was no system in place to do so, I went about building one.  The formula I'm currently working on is the last piece of the puzzle.



Basically, Im trying to set up a way for this spreadsheet to account for Vacation time carryover.  I am attempting to accomplish this by using an IF formula.  Column F is a ticker that subtracts the Column C(modified version of the persons start date) from Column G(todays date) to produce how many days into their Anniversary year they are in, to accurately track their accrual.


Ive come up with several different formulas, and it seems that some are turning up incorrect values. 

excelscreenshot.png 


In the screenshot above, youll see the formula in cell D17 indicates that if F17<=365, return the value of F17, but if false, return F17-365.  

The problem is, cell F17 IS less than or equal to 365, its 319, which means the value it should spit out is 319, and not -49.  

In a later incarnation of this spreadsheet, I tried adding an extra column with the number 365... see below:
excelscreenshot.png

The formulae are still producing false positives.  See the screenshot.   The formula I used, =IF(G13<=F13,G13, G13-F13), worked in cell D13,where G13 was not in fact less than or equal to 365.  But just below it, in cell D14, youll notice that G14 IS less than or equal to 365. Yet excel is telling me that its not.  Any thoughts?

----------


## FDibbins

Hi and welcome to the forum  :Smilie: 

column F look to be text, not values, test with =isnumber(cell-ref)  FALSE indicates text

Also, please do not upload a picture of your file...rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome is (manually entered is ok) and how you arrived at that. (exclude sensitive info).  Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you  :Smilie:   Also, not all members can upload picture files (Company firewalls and stuff)

----------


## daddylonglegs

F17 is probably treated as a text value and as such excel will deem it to be > than any number - do you have formulas in column F returning those values?

You can try converting to a number within the formula like this

=IF(F17*+0*<365,......

----------


## Jonmo1

Your values in column F are not really numbers, they are "Numbers stored as text"
As evidenced in your screenshot where it shows the Value_if_true part - F17 = *"*319*"*
Quote marks indicate TEXT.
Text values are considered Greater than Numbers.

To resolve,
Copy a blank cell
Highlight Column F
Right Click - Paste Special - Values - Add-  OK

----------


## ben_hensel

I can't say for sure based on a screenshot instead of a sample worksheet, but based on
1) the fact column F is left-aligned
2) that the IF is calling it "319" with the double quotes instead of just a number,

Indicates to me that you've got something screwy going on where it's getting assessed as text?

Wrap whatever's in F with the VALUE() function, maybe that will fix it.

----------

