VBA to assign consecutive value based on repeating data?

ABLucas

New Member
Joined
Jun 6, 2017
Messages
2
I have a sheet with tons of payment data that I need to assign an episode value. There are two columns in which there would be repeating data: Column "MRN" and Column "FDOS".

I want to assign a consecutive episode value of 0-5, to each row where the MRN & FDOS are repeating.

Example of how it looks when I manually enter the value in the Episode column. How can I make this less of a manual process?

MRN
Episode
FDOS
123
01/01/2017
123
01/01/2017
123
1
01/02/2017
123
1
01/02/2017
456
01/01/2017
456
01/01/2017

<tbody>
</tbody>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I have a sheet with tons of payment data that I need to assign an episode value. There are two columns in which there would be repeating data: Column "MRN" and Column "FDOS".

I want to assign a consecutive episode value of 0-5, to each row where the MRN & FDOS are repeating.

Example of how it looks when I manually enter the value in the Episode column. How can I make this less of a manual process?

MRN
Episode
FDOS
123
001/01/2017
123
001/01/2017
123
1
01/02/2017
123
1
01/02/2017
456
001/01/2017
456
001/01/2017

<tbody>
</tbody>

Not sure why it didn't display the "0" on rows 1, 2, 5, 6.

Thanks for any help or guidance!
 
Upvote 0

Forum statistics

Threads
1,216,735
Messages
6,132,423
Members
449,727
Latest member
Aby2024

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