Simulating an If While loop without the use of VBA

Gabbelgak

New Member
Joined
Dec 14, 2016
Messages
22
Hello. I've hit a snag and need to be able to create an effect similar to an if while loop without using vba. (computers at my work just delete any vba code unless I was to sit at each computer and build it for a user personally). I know I can easily do this with an If While loop but that isn't an option.

Example of what I am trying to do:

30 Days(variable # entered by user)
9/14/ 2014 Date 1 (variable entered by user)
11/3/2015 Date 2 (variable entered by user)


From date 1 it uses the day variable date until it reaches the one before date 2.

So in the above example it would go to 10/14/2014, 11/13/2014, 12/13/2014 and continue on til it reached 10/9/2015 (because 30 days after that would be 11/8/2015 which is past my date 2 variable)

I don't need any of the inbetween dates, it would just need 10/9/2015 in this example.

Is this possible to do without VBA code?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Nevermind I found an alternative that works without If's.

Using =Days(Date2,Date1)
Dividing that result by Days
Trunc that
Multiply the Trunc by Days
Add that result to date one
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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