current week, current month, current year

J

joemeshuggah

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).
 
J

Joel

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)
 
Top