Return Second to Last Date

e9jensen

New Member
Joined
Oct 4, 2013
Messages
5
I am trying to find the second to last invoice date in a sales table to calculate whether it has been twelve months since the last sale or a particular good to a given customer. For example, we sold something to Customer X on August 31, 2013 and the previous sale before that was July 1, 2012, which is the value I want returned to consider it "New". The formula below returns a value of August 31, 2013 for the date. Last Sale Date:=CALCULATE(LASTDATE(GMData[Invc Invoice Date]),DATESBETWEEN(Calendar[DateKey],BLANK(),LASTDATE(Calendar[DateKey])),ALL(Calendar))
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I'm going to be working on this but just to give you an idea of the approach that I have in mind:
- Use MINX() to get the 2nd to last invoice date
- TOPN() in order to just get the 2 newer invoice dates
- ALL() In order to override the current dates selection from the slicer

Hope this gives you an idea.
 
Upvote 0

Forum statistics

Threads
1,223,959
Messages
6,175,647
Members
452,663
Latest member
MEMEH

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