date comparison

drumsab

New Member
Joined
Sep 1, 2011
Messages
8
Hi,
I have two dates, one in cell A1 and one in cell B1 (start date and end date). The format is mm-cc-yy.

What I want for cells C2, D2, E2 and F2 is this:
if the year/mon in C1 is = or in between the year/mon of A1:B1, I wnt to set a value of 1 in C2, if not, then set a value of 0.

The resulting "formula" in cells C2, D2, E2 and F2 would then return the values shown in C3, D3, E3 and F3.

Your help is appreciated !

A B C D E F
1 03/01/2010 05/15/2011 10-Feb 11-Jan 10-Oct 11-Aug
2 0 1 1 0
3
4
5
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try

=--(C1=MEDIAN(C1,EOMONTH($A$1,-1)+1,EOMONTH($B$1,0)))
 
Upvote 0
It coerces logical results, i.e. TRUE / FALSE into 1 / 0 respectively, in effect it's the same as

=IF(C1=MEDIAN(C1,EOMONTH($A$1,-1)+1,EOMONTH($B$1,0)),1,0)
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

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