Calculate min value of a date in column based on criteria

Hermann01

New Member
Joined
May 6, 2013
Messages
4
Hi All,

I al struggling with an issue I can't solve, hope you will be smarter than I am...

I have a table, ProductLocationData, with 3 columns: Product IDs, Countries, and Month, and I need to know in a fourth column what is the first date for each combination of Product ID + Country. Hereunder an example of what I want to achieve, in the last column.
I tried the following formula (among other tests), which doesn't work:

First Date formula:
=calculate(MIN([Month]);FILTER(Month;ProductLocationData[Product ID] = [Product ID] && ProductLocationData[Country] = [Country] && MIN
(ProductLocationData[CycleDate]) = ProductLocationData[CycleDate]))

Any idea?
Table name ProductLocationData
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Product ID[/TD]
[TD]Country[/TD]
[TD]Month[/TD]
[TD]First Date?[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Denmark[/TD]
[TD]01/01/2013[/TD]
[TD]01/01/2013[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Denmark[/TD]
[TD]01/02/2013[/TD]
[TD]01/01/2013[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Denmark[/TD]
[TD]01/03/2013[/TD]
[TD]01/01/2013[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Sweden[/TD]
[TD]01/01/2013[/TD]
[TD]01/01/2013[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Sweden[/TD]
[TD]01/02/2013[/TD]
[TD]01/01/2013[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Finland[/TD]
[TD]01/02/2013[/TD]
[TD]01/02/2013[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]Finland[/TD]
[TD]01/03/2013[/TD]
[TD]01/02/2013[/TD]
[/TR]
[TR]
[TD]124[/TD]
[TD]Denmark[/TD]
[TD]01/01/2012[/TD]
[TD]01/01/2012[/TD]
[/TR]
[TR]
[TD]124[/TD]
[TD]Denmark[/TD]
[TD]01/02/2012[/TD]
[TD]01/01/2012[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
reading some other posts in your forum I finally tried:
=calculate(MIN([Month]);FILTER(ALL(ProductLocationData);[Product ID] = earlier([Product ID]) && [Country] = earlier([Country])))
AND
=calculate(MAX([Month]);FILTER(ALL(ProductLocationData);[Product ID] = earlier([Product ID]) && [Country] = earlier([Country])))

To get the first and the last date for each combination. It seams that it works.
If you can confirm, or have a better idea :)
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,578
Members
452,652
Latest member
eduedu

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