Assigning a reference to unique values in a range without sorting

HOGGL

New Member
Joined
Nov 2, 2017
Messages
7
The title is perhaps not very clear and not sure if this can be done - BUT any idea how I allocate something a reference number but meeting certain criteria.

What i'm trying to do is to say if the product (col B) is live (status col A) and has a certain code (col C) allocate the first instance number 1 and then the next instance number 2 and so on. And if the code changes start again at number 1. If the status is INACTIVE then just blank.

Kind of put what i want the output to be in column E. So if we look at code 7200 the first live instance in row 4 so that has been given 1, then row 5 - 2 and row 7 - 3. Row 6 has started again at 1 because it's the first instance of a live 1001 product.

Don't really want to sort the data by code (I know there's a fairly simple formula I could use if i do this).

ABCDE
1STATUSPRODUCTCODEDESIRED RESULT
2LIVECGLE300100010001
3INACTIVECGLE30010001000
4LIVECGLE300720020032572001
5LIVECGLE300720020022572002
6LIVECGLE300100110011
7LIVECGLE300720020032572003
8INACTIVECGLE30072002003257200

<tbody>
</tbody>

Hoping there's an answer.

Thanks in advance.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
maybe something like...

=IF(A2="inactive","",COUNTIFS($A$2:A2,"Live",$C$2:C2,C2))
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,871
Members
449,097
Latest member
dbomb1414

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