Earliest Date by Product Problems

robtop

New Member
Joined
Jan 20, 2011
Messages
20
Morning,

I have a table with a range of transactions for different products.

One of the columns is DateOfTransaction.

I'm trying to get the earliest transaction date for each product but what I'm actually getting is just the earliest transacton date overall.

I am expecting results to look like this:

Product Earliest Transaction Date

Shop Insurance 12/01/2012
Office Insurance 01/01/2012
Business Insurance 03/03/2012


However what i'm getting is:

Product Earliest Transaction Date

Shop Insurance 01/01/2012
Office Insurance 01/01/2012
Business Insurance 01/01/2012

The measure I'm using is as follows:

Earliest Product Trans Date:=calculate(MIN([DateOfTransaction]),[Product])

Any idea where I'm going wrong or what i need to do to fix it?

Thanks very much

Rob
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Is this what you need?

Drag E2 Down

Excel Workbook
ABCDE
1ProductTransaction DateProductEarliest Transaction Date
2Shop Insurance12/01/2012Shop Insurance11/01/2011
3Office Insurance01/01/2012Office Insurance01/01/2012
4Business Insurance03/03/2012Business Insurance03/01/2012
5Shop Insurance11/01/2011
6Office Insurance01/05/2012
7Business Insurance03/01/2012
8
9
10
Sheet1
 
Upvote 0
Could you just use Min - i.e.

Assuming:
Column A = Product Description
Column B = Date of transaction

Column F = The product name that you are looking up


The following formula (just an example with a small set of data, can change the numbers as needed) would go in the result cell, but after typing, you must enter the formula with Ctrl + Shift + Enter instead of just pressing Enter

=MIN(IF(A2:A6=F2,B2:B6))
 
Upvote 0
@ zakkarro

Your solution is fine, but for larger sheets array entered formulae can prove very expensive.

Here's the opinion of one MS MVP, on another forum that shall remain nameless ...
Perhaps the biggest problem with array formulae is that they look efficient, but when compared to an alternative, nothing could be further from the truth! An array formulae must follow rules that Excels built in Functions do not have to, that is they must loop through each and every cell they reference (one at a time) and check them off against a criteria. For this reason arrays are best suited to being used on single cells or referencing only small ranges.
 
Upvote 0
@ zakkarro

Your solution is fine, but for larger sheets array entered formulae can prove very expensive.

Here's the opinion of one MS MVP, on another forum that shall remain nameless ...

Thanks for the info Marcol ! I learn something every day :-)
 
Upvote 0
Thanks, but I think they are solutions for an excel table whereas I'm trying to do this in a Powerpivot model which doesn't have the cell references.
 
Upvote 0
I could not reproduce your results, and PP did not accept your measure.

Anyway, here is how I would do it:
Earliest Transaction Date:=CALCULATE(
MIN([DateOfTransaction])
,ALLEXCEPT(YourTable;YourTable[Product])
)
 
Upvote 0

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,646
Latest member
tudou

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