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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top