# if date in cell is within the last 2 weeks of december then "1"

#### Eyeson15

##### Board Regular
Hello,

Im going little crazy for the last hour.
I have several workbooks with dates column A.
It's in custom format, dd.mm.yy

I just need a simple '1' in column B next to all the dates that are within the last 2 weeks of December.
Some workbooks have 1000+ dates for over last 20 years.

It can be VBA or just formulae.

James

### Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

#### steve the fish

##### Well-known Member
Try this:

=IF(A1>=EOMONTH(A1,0)-13,1,FALSE)

#### Eyeson15

##### Board Regular
Try this:

=IF(A1>=EOMONTH(A1,0)-13,1,FALSE)

Hi Steve

It works good but shows 1 for last 2 weeks of every month. How do I only show 1 for December?

Thanks

#### steve the fish

##### Well-known Member
Oh yeah! Sorry give me a minute

#### steve the fish

##### Well-known Member
=if(a1>=date(year(a1),12,18),1,false)

#### Eyeson15

##### Board Regular
=if(a1>=date(year(a1),12,18),1,false)

HOT DAAMN
You did it!
I will think about you before I sleep tonight.

Last edited:

#### steve the fish

##### Well-known Member
Further to PM:

=IF(A1<=DATE(YEAR(A1),MONTH(A1),7),1,FALSE)
=IF(A1<=DATE(YEAR(A1),1,7),1,FALSE)

Replies
4
Views
453
Replies
2
Views
54
Replies
9
Views
129
Replies
3
Views
69
Replies
1
Views
369

1,191,287
Messages
5,985,752
Members
439,979
Latest member
alekun86

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