Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default current week, current month, current year

is it possible (either via vba or some function in excel) to indicate where a
particular date falls (e.g. within the current week, current month, and
current year)?

looking to create a report that identifies records as falling into current
week, current month (excluding those that fall within current week), and year
to date (excluding those that fall within current week and current month).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default current week, current month, current year

If your date is in A1

Current Year

if(year(A1)=year(today()),True,False)

Current Month

if(month(A1)=month((today()),True,False)

Current week depends on when the week starts (Saturday, Sunday, Monday)
for Sunday

=if(And(A1=Today()-weekday(Today()),A1<Today()-weekday(Today())+6),true,false)




"joemeshuggah" wrote:

is it possible (either via vba or some function in excel) to indicate where a
particular date falls (e.g. within the current week, current month, and
current year)?

looking to create a report that identifies records as falling into current
week, current month (excluding those that fall within current week), and year
to date (excluding those that fall within current week and current month).

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
Current year and current week number Grey Old Man[_2_] Excel Discussion (Misc queries) 11 December 8th 09 06:30 PM
Year-to-date based on current month John in Toronto Excel Discussion (Misc queries) 2 May 9th 08 04:23 PM
input box default values (current month, year) mwam423 Excel Programming 5 June 12th 07 02:05 AM
Show week number in current month DKerr Excel Discussion (Misc queries) 4 February 23rd 06 09:20 PM
HELP - need to returns the current number of past month this year and ... elz64 Excel Worksheet Functions 6 April 6th 05 01:37 PM


All times are GMT +1. The time now is 04:21 PM.

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"