Choosing the next date based on current date.

Drrellik

Well-known Member
Joined
Apr 29, 2013
Messages
834
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
Platform
  1. Windows
Hello all,

I have looked through the forums and done several searches, I found this link and I like the VBA approach to counting down to a target date: Countdown to an event?

I am creating a reminder to purchase my lottery tickets before the target date.

So opening the workbook I can use this VBA counter what I am trying to figure out is what approach to take when determining the next lottery draw

Dates are specific days of the week i.e Tuesday (3) and Friday (6) if I use =(WEEKDAY(TODAY(),1)) I can return the day of the week numeric value and format the cells as needed, what I am looking for are your thoughts on how to use simple formulas to accomplish this.

just drawing a blank and I always hate time formulas.

Cell 1 =today()
Cell 2 =next draw date (target date) either Tue or Fri
Cell 3 time remaining which I can use the VBA for the count down.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
What behaviour do you want to see on a Tuesday and Friday - should it show the current date as the target or the next one (i.e. on a Tuesday show the following friday, on a Friday, the following Tuesday)

Also, do you want to consider the time element, and using "NOW()" rather than "Today()"?

Cell1 = E4 in the following examples, adjust as required.

=IF(WEEKDAY(E4,15)<5,E4-WEEKDAY(E4,15)+5,E4-WEEKDAY(E4,15)+8)
Friday to Monday this will return the following Tuesday. Tuesday to Thursday the following Friday.

=IF(WEEKDAY(E4,16)<=4,E4-WEEKDAY(E4,16)+4,E4-WEEKDAY(E4,16)+7)
Saturday to Monday this will return the following Tuesday. Wednesday & Thursday will return the following Friday. Tuesday and Friday will return the current date.
 
Upvote 0
Here are two shorter formulas that return the same results:

=WORKDAY.INTL(E4,1,"1011011")

=WORKDAY.INTL(E4-1,1,"1011011")
 
Upvote 0
FatBoyClam, & Tetra201 both in cell formulas work and are easy enough to follow. I was leaning towards an IFS statement and trying to evaluate <=3 >=6 and dealing with more than 24 hours was frustrating me so I am thankful for the help.
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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