Need excel formula help

exceldummy77

New Member
Joined
Dec 7, 2010
Messages
27
Hi everyone,

I need some help with creating a formula that will number each line but then there is a monkey wrench thrown in there

<table width="230" border="0" cellpadding="0" cellspacing="0"><colgroup><col style="mso-width-source:userset;mso-width-alt:4059;width:83pt" width="111"> <col style="mso-width-source:userset;mso-width-alt:4352;width:89pt" width="119"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt;width:83pt" width="111" height="20">ID</td> <td class="xl65" style="width:89pt" width="119">Match
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">125</td> <td class="xl68" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001140</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">126</td> <td class="xl68" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001143</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl69" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">127</td> <td class="xl70" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001144</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl69" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">127</td> <td class="xl70" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001144</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl72" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">128</td> <td class="xl73" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001146</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl72" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">128</td> <td class="xl73" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001146</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl72" style="height:15.0pt;border-top:none; width:83pt" width="111" height="20">128</td> <td class="xl73" style="border-top:none;border-left:none;width:89pt" width="119">ABC00001146</td> </tr> </tbody></table>

So I can filldown to number for me, but the issue is when I hit a set of records where the match is the same, they all will need to have the same ID number. Does someone have a good excel formula that can run this for me (I have a set of 10K that I have to run against them).

Thanks in advance again!
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Are the values sorted so that all the duplicates are grouped together?
If So, try

Assuming headers in Row 1, data starting in Row2.
Data in Column B
In A2 put your Starting ID #
In A3 put

=A2+(B2<>B3)

Fill down to end of Data.
 
Upvote 0
If you start with:-

<TABLE style="WIDTH: 165pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=221><COLGROUP><COL style="WIDTH: 35pt; mso-width-source: userset; mso-width-alt: 1718" span=2 width=47><COL style="WIDTH: 95pt; mso-width-source: userset; mso-width-alt: 4644" width=127><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=21 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #3867a6 1pt solid; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 width=47>
A
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #3867a6 1pt solid; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 width=127>
B
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6 1pt solid; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
1
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 width=47>
ID
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 width=127>
Match
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
2
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
125
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001140
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
3
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001143
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
4
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001144
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
5
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001144
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
6
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001146
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
7
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001146
</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6 1pt solid; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; HEIGHT: 15.75pt; BORDER-TOP: #3867a6; BORDER-RIGHT: #3867a6 1pt solid" class=xl66 height=21 width=47>
8
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #3867a6; BACKGROUND-COLOR: #efefef; WIDTH: 35pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl67 width=47>
</TD><TD style="BORDER-BOTTOM: #3867a6 1pt solid; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: #efefef; WIDTH: 95pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #3867a6 1pt solid" class=xl68 width=127>
ABC00001146


</TD></TR></TBODY></TABLE>

Place =IF(B3=B2,A2,A2+1) in A3 and copy down.
 
Upvote 0
Yup, they are grouped together so this works! Thanks a bunch!

Are the values sorted so that all the duplicates are grouped together?
If So, try

Assuming headers in Row 1, data starting in Row2.
Data in Column B
In A2 put your Starting ID #
In A3 put

=A2+(B2<>B3)

Fill down to end of Data.
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,310
Members
452,906
Latest member
phanmemchatdakenhupviral

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