Wierd Date thing

eddipowers

New Member
Joined
Oct 31, 2018
Messages
2
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px} </style>Hi All


Can somebody please tell me why these statements come out this way?


K1 = 01/10/2018 (Dropdown list with value from a table formatted "mmmm ii")
J21 = 02/09/2018


=IF(MONTH(K1)&YEAR(K1)<MONTH(J21)&YEAR(J21);"TRUE";"FALSE") "Excel says True" (outcome 102018 < 92018)
=IF(MONTH(K1)&YEAR(K1)>MONTH(J21)&YEAR(J21);"TRUE";"FALSE") "Excel says False" (outcome 102018 > 92018)


=IF(YEAR(K1)&MONTH(K1)>YEAR(J21)&MONTH(J21);"TRUE";"FALSE") "Excel says False" (outcome 201810 > 20189)


I am using the statements in IF formulas, so it is pretty annoying.
Can somebody tell me what I am doing wrong or why excel is doing this.


Thanks in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Excel 2010
JK
101-10-18
2
3true
4FALSE
5FALSE
6
2b
Cell Formulas
RangeFormula
K3=IF(MONTH(K1)&YEAR(K1)J21)&YEAR(J21),"true","false")
K4=(MONTH(K1)&YEAR(K1))+0<(MONTH(J21)&YEAR(J21))+0
K5=K1


You are comparing Text; you could coerce the Text to numbers.
or compare the original values (True Dates).
 
Upvote 0
you could try something like this:
Code:
=IF(YEAR(K1) +12*MONTH(K1)>YEAR(J21) +12*MONTH(J21),"TRUE","FALSE")
 
Upvote 0
Hi thanks, guys!

It helps with adding a value to the functions. In my case, I used @offthelip 12* in front of the month. But you both have the same approach. Thank you very much for using time on this.
 
Upvote 0

Forum statistics

Threads
1,225,754
Messages
6,186,826
Members
453,377
Latest member
JoyousOne

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
Back
Top