Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Saurabh
 
Posts: n/a
Default How can i filter dates based on day of month

I want to filter out last 2 days of month from daily return data of a stock
for 20 years. Please suggest
  #2   Report Post  
Daniel.M
 
Posts: n/a
Default

Hi,

Assuming your dates are in column A, so A1 is a title, data starts on second
row.

1. If you meant that the dates must be the 2 last days of a month (Jan 30 & Jan
31 for example):

You leave D1 blank (this is important)
In D2: =DAY(A2+2)<3

Use the Advance Filter (Menu Data/Filter/Advanced Filter) and specify D1:D2 as
your CRITERIA range

2.
If you meant the last 2 days in the month amongst the data you have.
Add another column (called Is2LastDays), say column C
C1: Is2LastDays
in C2, the following array formula :
=A2=LARGE(IF(A$2:A$x-DAY(A$2:A$x)=A2-DAY(A2),A$2:A$x),2)

Copy C2 to Cx (as many rows as you have in column A).

Use the AutoFilter (Menu Data Filter/AutoFilter) and then pull down C1 to choose
the TRUE values.

Regards,

Daniel M.

"Saurabh" wrote in message
...
I want to filter out last 2 days of month from daily return data of a stock
for 20 years. Please suggest



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter by month Marci Excel Discussion (Misc queries) 3 January 10th 05 05:53 AM
Sum based on month Excel Worksheet Functions 1 December 5th 04 02:33 AM
Total number of each month in a column of dates GeorgeF. Excel Worksheet Functions 1 November 19th 04 06:10 PM
Totals based on dates DJ Dusty Excel Worksheet Functions 1 November 16th 04 10:39 PM
how to add up number of columns based on month eg feb = 2 oct = 1. cookie Excel Worksheet Functions 8 November 5th 04 11:18 AM


All times are GMT +1. The time now is 03:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"