Need help in making Serial No

Santosh080

Board Regular
Joined
Jul 15, 2016
Messages
77
Office Version
  1. 2021
Platform
  1. Windows
Hello Friends,

I need some help in the below table. I have an excel file like this. Now i want to put serial no 1,2,3 like this but according to ID Type Column whichmeans first serial number for AA ID Type starts from 1 to 4 then for ID Type BB it starts from 1 not continuing from serial number of AA. Can it possible ?

Thanks



[TABLE="class: grid, width: 235"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD][/TD]
[TD]Sl. No
[/TD]
[TD]ID Type
[/TD]
[TD]Name[/TD]
[TD]A/C No.
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]AA[/TD]
[TD]xlkopswp[/TD]
[TD="align: right"]135645[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]AA[/TD]
[TD]dskzxzz[/TD]
[TD="align: right"]545345[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]AA[/TD]
[TD]cxzcc[/TD]
[TD="align: right"]65636
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]AA[/TD]
[TD]czxczdsd[/TD]
[TD="align: right"]5345252
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]BB[/TD]
[TD]cxcdfd[/TD]
[TD="align: right"]454646[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]BB[/TD]
[TD]cxcxcf[/TD]
[TD="align: right"]645656[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]
[/TD]
[TD]CC[/TD]
[TD]wgtgy[/TD]
[TD="align: right"]4535
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]CC[/TD]
[TD]sdsds[/TD]
[TD="align: right"]5645[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]CC[/TD]
[TD]fzdcfxfdf[/TD]
[TD="align: right"]345435[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]DD
[/TD]
[TD]sefrtsdfs[/TD]
[TD="align: right"]4545[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]DD[/TD]
[TD]fdfstgy[/TD]
[TD="align: right"]65576[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]DD[/TD]
[TD]fsdterwe
[/TD]
[TD="align: right"]757567[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD]DD[/TD]
[TD]gsetsetrse[/TD]
[TD="align: right"]545
[/TD]
[/TR]
</tbody>[/TABLE]


I want serial number like this which change according to ID Type,

[TABLE="class: outer_border, width: 235"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Sl. No
[/TD]
[TD]ID Type[/TD]
[TD]Name[/TD]
[TD]A/C No.[/TD]
[/TR]
[TR]
[TD] 1
[/TD]
[TD]AA[/TD]
[TD]xlkopswp[/TD]
[TD="align: right"]135645[/TD]
[/TR]
[TR]
[TD] 2
[/TD]
[TD]AA[/TD]
[TD]dskzxzz[/TD]
[TD="align: right"]545345[/TD]
[/TR]
[TR]
[TD] 3
[/TD]
[TD]AA[/TD]
[TD]cxzcc[/TD]
[TD="align: right"]65636[/TD]
[/TR]
[TR]
[TD] 4
[/TD]
[TD]AA[/TD]
[TD]czxczdsd[/TD]
[TD="align: right"]5345252[/TD]
[/TR]
[TR]
[TD] 1
[/TD]
[TD]BB[/TD]
[TD]cxcdfd[/TD]
[TD="align: right"]454646[/TD]
[/TR]
[TR]
[TD] 2
[/TD]
[TD]BB[/TD]
[TD]cxcxcf[/TD]
[TD="align: right"]645656[/TD]
[/TR]
[TR]
[TD] 1
[/TD]
[TD]CC[/TD]
[TD]wgtgy[/TD]
[TD="align: right"]4535[/TD]
[/TR]
[TR]
[TD] 2
[/TD]
[TD]CC[/TD]
[TD]sdsds[/TD]
[TD="align: right"]5645[/TD]
[/TR]
[TR]
[TD] 3
[/TD]
[TD]CC[/TD]
[TD]fzdcfxfdf[/TD]
[TD="align: right"]345435[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]DD[/TD]
[TD]sefrtsdfs[/TD]
[TD="align: right"]4545[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]DD
[/TD]
[TD]fdfstgy[/TD]
[TD="align: right"]65576[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]DD[/TD]
[TD]fsdterwe
[/TD]
[TD="align: right"]757567[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]DD[/TD]
[TD]gsetsetrse[/TD]
[TD="align: right"]545
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Assuming the data is sorted on ID Type and ID Type is in Column B and SI No is in Column A, enter this formula in Cell A2.
=IF(B2=B1,A1+1,1)
 
Upvote 0
If the SI number starts from cellA2 down and the Type ID is in column B, type the following formula in A2:

=IF(B2=B1,A1+1,1)

Then copy the formula down along column A

That should work.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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