Formula's with dates

PGD15

Board Regular
Joined
Aug 5, 2016
Messages
137
Hi,

I am awful with formula's that relate to dates, this should be an easy request.

I want to say if cell a (example) is equal to the month in cell b (this is in date format so 01/06/2018, for june) then display the date six months ago (01/01/2018).

thanks in advance
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Does column A contain a date, or just the month number? And what result do you want if they're not the same month?
 
Upvote 0
Does column A contain a date, or just the month number? And what result do you want if they're not the same month?

I think I worded this badly... let me re-try

I want to say if cell A1 (contains date, shown as june-18 = 01/06/2018) then i want the value in cell b1 to be equal to the date six months ago.

so a1 - June-18
i want b1 to display Jan-18

if the cell data in a1 changes i want b1 to automatically change too.

is the clearer?
 
Upvote 0
so a1 - June-18
i want b1 to display Jan-18

is the clearer?
Not really, as 6 months before June is December in the previous year. ;)

In any case, try
=EDATE(A1,-6)
If you really want June to become January then change the 6 to 5.
 
Upvote 0
Either of the below should work for you.
Sheet1

AB
101/06/201801/01/2018
201/06/201801/01/2018
301/06/201801/01/2018

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:75px;"><col style="width:75px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B1=EDATE(A1,-5)
B2=EOMONTH(A2,-6)+1
B3=DATE(YEAR(A3),MONTH(A3)-5,1)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thanks both,

Once again Peter don't question my maths :) I wanted 6 months but that was irrelevant to the dates I gave, just an example so I can adapt to work.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,265
Messages
6,123,961
Members
449,135
Latest member
jcschafer209

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