Dates

andy_2610

Board Regular
Joined
Jan 29, 2015
Messages
168
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?

Thanks in advance,

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
Joined
Oct 12, 2006
Messages
44,061
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)
 
Upvote 0

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,471
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.
 
Upvote 0

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
68,034
Office Version
  1. 365
Platform
  1. Windows
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]
 
Upvote 0

doncarp

Board Regular
Joined
Aug 21, 2004
Messages
55
Office Version
  1. 2016
Platform
  1. Windows
ADVERTISEMENT
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)
 
Upvote 0

Forum statistics

Threads
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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top