how to get a date of past time

SKV

Active Member
Joined
Jan 7, 2009
Messages
257
Hi,

I want to get a date 4 weeks back from a said date. So if I have a date of April 15, I should get output as March 15.

Please suggest the method to get this output.

Thanks
Sachin
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Ethvia

Board Regular
Joined
Mar 10, 2009
Messages
63
There are probably many ways, but here's one:

14 days ago: (Now())-14

so this is taking the current date and time and subtracting 14 days...you can make it any number of days you want.
 
Upvote 0

SKV

Active Member
Joined
Jan 7, 2009
Messages
257
Just got a better way to do it. - use dateadd()

There are probably many ways, but here's one:

14 days ago: (Now())-14

so this is taking the current date and time and subtracting 14 days...you can make it any number of days you want.
 
Upvote 0

Ethvia

Board Regular
Joined
Mar 10, 2009
Messages
63
took me a minute to figure out how on earth DateAdd() would give you a date 1 month ago...but I supposed if you specify a negative number then it would.

:biggrin:
 
Upvote 0

Forum statistics

Threads
1,191,686
Messages
5,988,066
Members
440,125
Latest member
vincentchu2369

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
Top