Excel - sequential numbering with countif

Phil Brining

New Member
Joined
Nov 21, 2013
Messages
2
Hope someoene can help with this.

I have an excel sheet that I routinely import into Salesforce. The sheet is an extract from Sage containing data relating to Orders placed by Customers. Each row in the sheet contains an Order Number and order details. If an order comprised five items then the order number would occur five times in the sheet.

What I want to do is apply a unique text string to each row comprising the Order Number and then a sequential number based on the number of occurrences in the list. E.g. if my list contained the following order numbers: 45678, 45699, 45678, 45234, 45672, 45699, 48230, 45678

I want a formula to create the following:
45678-1, 45699-1, 45678-2, 45234-1, 45672-1, 45699-2, 48230-1, 45678-3

I.e. 45678-3 is the third occurrence of the invoice number 45678 and so on.

I'm using Excel 2007 on Win7.

Any ideas?

Thanks

Phil
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the forum!

If your order numbers start in A1, say, then use this formula for your first cell, and copy/paste it down that column:

=A1&"-"&COUNTIF(A$1:A1,A1)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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