# First Product Sold in a customer?

#### Manish Mahajan

##### New Member
Hi
This is my first post here, and my days of frustration finally led me here. Would request some help please. Stuck on this problem since several days now.

Data Set: I have the following data set. Illustrative shown below, the actual data runs into several thousands of rows. As you can see, the customer id repeats, product also repeats and month of earliest purchase can also be repeating.

 Customer Id Product Month of Earliest Purchase D1 Bread Dec-13 D1 Wine Oct-13 D2 Chalk Feb-13 D2 Milk May-13 D2 Bread Jan-13 D2 Clips Jan-13 D3 Pencil Mar-14 D4 Bread Jan-13 D4 Pencil Jan-13 D4 Chalk Jan-13 D4 Milk Jan-13

<tbody>
</tbody>

From the above dataset, I want to extract first product sold in a customer and arrange it as below

 Customer Id First Product Sold Month of Earliest Purchase D1 Wine Oct-13 D2 Bread + Clips Jan-13 D3 Pencil Mar-14 D4 Bread + Pencil + Chalk + Milk Jan-13

<tbody>
</tbody>

Is there a way to do this? Any help would be greatly appreciated. Thanks

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### Oeldere

##### Well-known Member
for D4 this is AND or this is an OR statement.

Do all criteria's have to met?

#### Manish Mahajan

##### New Member
for D4 this is AND or this is an OR statement.

Do all criteria's have to met?

Hi Oeldere
Yes it is a AND view, which is part of the problem. Using Vlookup, INdex/match only returns the first match. In case of D4, we have as many as four products all bundled in the month. So for D4, the answer should indicate all the four products!

#### vds1

##### Well-known Member
I have a partial solution..

Lets assume your data is in Column A , B and C

First sort columns ABC by Customer ID , then add level, Month of earliest Purchase (oldest to newest)

In D2, Insert below formula and drag down,

=IF(A2=A1,IF(C2=C1,"First Product","Not First Product"),"First Product")

#### Oeldere

##### Well-known Member
Mabye with an filter on costumer (D4).

#### Manish Mahajan

##### New Member
I have a partial solution..

Lets assume your data is in Column A , B and C

First sort columns ABC by Customer ID , then add level, Month of earliest Purchase (oldest to newest)

In D2, Insert below formula and drag down,

=IF(A2=A1,IF(C2=C1,"First Product","Not First Product"),"First Product")

I have managed to get the first unique product out, by some similar method as suggested by you. In fact, I have gone a step further and instead of getting "Not First Product" I get "2 Products" or "3 Products" so on. But the challenge remains in identifying the product name whenever I get "2 Products" or "3 Products"

Replies
1
Views
593
Replies
0
Views
753
Replies
3
Views
374
Replies
1
Views
537
Replies
2
Views
6K

1,195,623
Messages
6,010,749
Members
441,567
Latest member
Flitbee

### 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.

### Which adblocker are you using?

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

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