Same formula - different result in other workbook

nielf

Board Regular
Joined
Nov 13, 2012
Messages
69
I have created formula to determine if a date falls is between two dates.

The formula looks like this (in a Table):
Code:
=AND([@CalcDatesMerged]>EOMONTH(TODAY();-14);[@CalcDatesMerged]<=EOMONTH(TODAY();-1))

I tested the formula in a dummy workbook and the result was like I expected it to be. 29-02-2016 is FALSE as it is supposed to be.
A5lvDn9.png


However, when I copy the formula to another workbook the result is no longer the same. For some reason 29-02-2016 is now TRUE:

5SWh7Vs.png


It is the exact same formula but with two different results. For some reason the last day of the month is included in the second example and I have no idea why.

Are there any date settings or something else that could be causing this - or am I just missing something obvious?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I would do the following:

- Select cell F6472
- Go to the formulas tab
- Evaluate the formula

If I was to guess, I'd say the value in column E has a time component as well (e.g. "29-02-2016 01:00:00"). Try selecting E6472 and changing the cell format to General or Number. Perhaps it's not a whole number? If that's the case then your formula should be:

=AND(INT([@CalcDatesMerged])>EOMONTH(TODAY();-14);INT([@CalcDatesMerged])<=EOMONTH(TODAY();-1))

WBD
 
Upvote 0
I would do the following:

- Select cell F6472
- Go to the formulas tab
- Evaluate the formula

If I was to guess, I'd say the value in column E has a time component as well (e.g. "29-02-2016 01:00:00"). Try selecting E6472 and changing the cell format to General or Number. Perhaps it's not a whole number? If that's the case then your formula should be:

=AND(INT([@CalcDatesMerged])>EOMONTH(TODAY();-14);INT([@CalcDatesMerged])<=EOMONTH(TODAY();-1))

WBD

Thank you very much for your input. I tried using your formula and that worked as charm.

You saved me from getting grey hair :)
 
Upvote 0

Forum statistics

Threads
1,216,575
Messages
6,131,501
Members
449,654
Latest member
andz

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