Numbering Unique Dates by Customer

Charles651

New Member
Joined
Jul 11, 2015
Messages
6
Hi, all. First time posting to this site but long-time lurker. I need a formula to add a column to my data that numbers each customer's orders based on the purchase date. The table contains a separate row for each item ordered by a customer, so there may be several rows with the same order date for an individual customer, but all order dates that are the same for an individual customer would be assigned the same number. The first (earliest) order date for each customer would be numbered "1", the second order date numbered "2", and so on until all unique order dates for each customer are numbered.

The columns in my spreadsheet are shown in example columns A-C below. The order number I want to add will be in column D.

Thanks for any and all guidance as I have no idea about how to do this!

ABCD
CustomerIDOrderDateItemIDOrder
John Doe06/01/2014555551
John Doe06/01/2014123451
John Doe10/12/2014XYZ992
Jane Doe07/19/2014AZ1231
Jane Doe09/01/2014999992
Jane Doe10/05/2014777773

<tbody>
</tbody>
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
D2, control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF($A$2:A2=A2,$B$2:B2),$B$2:B2),1))
 
Upvote 0
Aladdin, thank you for the prompt reply to my question. I entered the formula exactly as you suggested, including using control-shift-enter to fill the cells. However, I get the same result, the number 1, for all cells. Do you have any suggestions on how to troubleshoot this? Thanks again!
 
Upvote 0
Aladdin, thank you for the prompt reply to my question. I entered the formula exactly as you suggested, including using control-shift-enter to fill the cells. However, I get the same result, the number 1, for all cells. Do you have any suggestions on how to troubleshoot this? Thanks again!

Are the records not sorted on CustomerID and the on OrderDate?

Note. Control+shift+enter means: Press down the control and the shift keys at the same time while you hit the enter key.
 
Upvote 0
Are the records not sorted on CustomerID and the on OrderDate?

Note. Control+shift+enter means: Press down the control and the shift keys at the same time while you hit the enter key.


Yes, the records are sorted by both CustomerID and on OrderDate. I also held down the control and shift keys while pressing the enter key as you do for entering array formulas.
 
Upvote 0

Aladin,
Thank you for your help. After viewing your spreadsheet, I realized my cell references were not updating from cell to cell because I had selected the entire column before entering the array formula instead of entering it in the first cell then copying it down. Embarrassing!

You have helped me to save many hours of work, so I'm very grateful.

Charles
 
Upvote 0
Aladin,
Thank you for your help. After viewing your spreadsheet, I realized my cell references were not updating from cell to cell because I had selected the entire column before entering the array formula instead of entering it in the first cell then copying it down. Embarrassing!

You have helped me to save many hours of work, so I'm very grateful.

Charles

You are welcome.
 
Upvote 0

Forum statistics

Threads
1,216,473
Messages
6,130,838
Members
449,597
Latest member
buikhanhsang

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