# Dates

#### andy_2610

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

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

#### Jonmo1

##### MrExcel MVP
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)

#### AlphaFrog

##### MrExcel MVP
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.

#### Joe4

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

Do you need to TEXT function at all? Why not just use:
Code:
``[COLOR=#333333]=DATE(2014, 1, 1)+(COLUMNS('JA Q1'!\$A:D)-1)*14+19[/COLOR]``
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:
``[COLOR=#333333]=IF(DATEVALUE(E3)>=TODAY(),E4-E5,0)[/COLOR]``

#### doncarp

##### Board Regular
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)

#### andy_2610

##### Board Regular
Thanks everyone!

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

You're welcome

Replies
4
Views
342
Replies
6
Views
430
Replies
7
Views
239
Replies
3
Views
547
Replies
3
Views
227

1,195,702
Messages
6,011,200
Members
441,594
Latest member
AVO

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back