# Thread: Dates Thanks: 0 Likes: 0

1. ## Dates

I am a little confused how this works..
Here is my example:

Cell E3 =TEXT(DATE(2014, 1, 1)+(COLUMNS('JA Q1'!\$A:D)-1)*14+19, "mm/dd/yy") =03/03/2014
Cell E4 = 60.00
Cell E5 = 80.00

Cell E6 =IF(E3>=TODAY(),E4-E5,0) =(20.00)

So basically in cell E6. Why is this returning (20.00) if my statement is greater than or equal to today's date which is 05/27/2015? Should it be returning 0?

Andrew

2. ## Re: Dates

The TEXT function returns....well....TEXT.
Even if it looks like a number or date, it's still just a TEXT string.

And believe it or not, the > and < operators consider TEXT strings to be greater than numbers/dates
So E3 > = TODAY() = TRUE

Why do you need the TEXT function in E3 ?
Why not just let it return a real date value, and use Cell formatting to make it appear in the format you like?

Change E3 to =DATE(2014, 1, 1)+(COLUMNS('JA Q1'!\$A:D)-1)*14+19

OR

Change formula in E6 to convert the E3 string to a true date value
=IF(E3+0>=TODAY(),E4-E5,0)

3. ## Re: Dates

The value in E3 is Text and not a serial date.

Try this in E3
=DATE(2014, 1, 1)+(COLUMNS('JA Q1'!\$A:D)-1)*14+19

Format E3 with any date format you like.

4. ## Re: Dates

The TEXT function returns a Text value, not a Date value.

Do you need to TEXT function at all? Why not just use:
Code:
`=DATE(2014, 1, 1)+(COLUMNS('JA Q1'!\$A:D)-1)*14+19`
and format cell E3 as a date in "mm/dd/yyyy" format?

Otherwise, you will need to convert it back to a date in E6 like this:
Code:
`=IF(DATEVALUE(E3)>=TODAY(),E4-E5,0)`

5. ## Re: Dates

You are getting the correct result. From your question, it sounds like you want to reverse the position of E3 and Today(). The formula below would yield 0.

Cell E6 =IF(TODAY()>=E3,E4-E5,0)

6. ## Re: Dates

Thanks everyone!

I didn't realize I had it in text or why i did that... Oops.

7. ## Re: Dates

You're welcome

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•