Serial Number Logic

Shushant27

New Member
Joined
Dec 15, 2016
Messages
3
Hello,

I am trying to have a serial number logic, as below:-


[TABLE="width: 147"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Sr. No.[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]AB005[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]AB005[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]AB006[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]AB007[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]AB007[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]AB008[/TD]
[/TR]
</tbody>[/TABLE]


Column 1 is Sr. No., Column 2 is Code Number.
Now, I am need that Sr. no. should ignore while dragging, if the cell next to it is same as the cell above it.

please help/ suggest some trick/ logic

Shushant
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I want to have serial numbers, based on the "Code" Column.

Sr. No. Should go 1,2,3......, but if cell in the "Code" column is same as above it like in example: AB005 comes 3 times. Then it should consider it only once in the serial number.


[TABLE="class: cms_table, width: 147"]
<tbody>[TR]
[TD]Sr. No.[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]AB005[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]AB005[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]AB006[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]AB007[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]AB007[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]AB008[/TD]
[/TR]
</tbody>[/TABLE]


 
Upvote 0
Try this in A2 copied down:

=IF(B2=B1,"",COUNT(A$1:A1)+1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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